Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Luau Language #244

Open
MonzterDev opened this issue Sep 11, 2023 · 5 comments
Open

Adding Luau Language #244

MonzterDev opened this issue Sep 11, 2023 · 5 comments

Comments

@MonzterDev
Copy link

Hey, it's likely quite a niche case, but I was curious if there was any interest in adding Luau to the compatible languages. This is Roblox's open-source fork of Lua, which can be found here: https://github.com/Roblox/luau

@KevinBatdorf
Copy link
Owner

How different is it from Lua? Their official docs just use the Lua grammar for their code examples. See here: https://luau-lang.org/syntax

Here's how Lua looks (you can edit the code with your own to see an example): https://code-block-pro.com/themes?theme=andromeda&lang=lua

But for adding it, I just need a link to the grammar file, which is usually a .tmLanuage file, but could be .json. Or a link to a VS Code extension page. I submit them upstream to shiki, and it sometimes takes a few weeks before they are released.

@MonzterDev
Copy link
Author

Hey, I really appreciate the quick response!

They're very similar, but Luau has a few different features, and I imagine this will only grow with time.

For instance, they recently added String Interpolation:

local world = "world"
local string1 = `Hello {world}!`

They've also recently added an if-then-else expression:

local x = if FFlagFoo then A else B

I was unable to find a grammar file from their website or repo, but they do have a grammar page: https://luau-lang.org/grammar

In addition to the page, there are also two VS Code extensions which hopefully will suffice:
https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.luau-lsp
https://marketplace.visualstudio.com/items?itemName=UnderMyWheel.roblox-lua

@KevinBatdorf
Copy link
Owner

This one looks right. I'll look into whether its possible to add this directly to the plugin, but if not then it might take a couple of weeks or more before they tag a release in the main repo.

https://github.com/JohnnyMorganz/luau-lsp/blob/main/editors/code/syntaxes/Luau.tmLanguage.json

I'll follow up this weekend though

@KevinBatdorf
Copy link
Owner

I added a PR to the main library to add the language, now just need to wait for them to make a release.

I attempted to sideload the language but it just woulnd't load in no matter what I tried. I guess it's buggy.

I'll follow up here when it's merged in, but might be a few weeks.

@MonzterDev
Copy link
Author

I'm so glad to hear. Thanks so much for the professional and swift handling of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants