-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Improve lua grammar #140489
Comments
Thanks for reaching out @sumneko. I looked for Lua.plist in https://github.com/sumneko/lua-language-server, but I wasn't able to find it. Can you point me to where in your extension you use the grammar file? Does your extension depend on https://github.com/sumneko/lua.tmbundle? When adopting a new grammar file in VS Code we want to make sure we're moving to a better supported grammar then the old one. I can see that your extension has regular releases, which is great. I want to understand how the new grammar repo fits into the extension, and whether you'll continue to make fixes for the grammar. |
Yes, the Lua.plist is https://github.com/sumneko/lua.tmbundle/blob/master/Syntaxes/Lua.plist .
In fact I maintain the grammar file by manually modifying the json file, and I used a script in the above project to convert json to plist. I will countinue make fixes for the grammar, it has been part of my extension before. |
That all sounds great, thanks for the answers. We don't require a plist file, a tmLanguage.json file is also good, so no need to maintain a plist if that isn't your preference. Let's try using https://github.com/sumneko/lua.tmbundle in VS Code at the beginning of our February iteration. That way, the changes will have the entirety of the February iteration to be used by VS Code insiders users before being released. |
Is EmmyLua already the standard? I've been stuck with LDoc for a long time so will that be supported? |
Since I don't use LDoc, I don't support it, but PRs are welcome. |
|
Thank you @sumneko |
Reopening for visibility. |
@sumneko I was not able to genericise the Lua documentation tags between block and inline comments, so I think I'll open a request on the bundle repo Edit: LuaLS/lua.tmbundle#1 |
Sorry I just found that the issues function is disabled in https://github.com/sumneko/lua.tmbundle . |
I have not seen an increase in issues for lua syntax highlighting since switching to the new grammar. Closing as fixed! Thank you @sumneko. |
Marking as verified since the colorization tests pass. |
The current lua grammar is a little poor, such as:
Many tokens are not catched:
Dose not support tokens after Lua 5.2
Dose not support
EmmyLua
, whitch is a type annotation system that has become the de facto standardSince the source project is no longer active (I have created a PR there 3 years ago), I created a new project to provide the grammar file: https://github.com/sumneko/lua.tmbundle/blob/master/Syntaxes/Lua.plist
The effect of the above code after using this grammar file is:
The grammar file has been in my extension for several years and it works fine.
I hope that it can be set as the default lua grammar file of VSCode, so that theme developers can better optimize the color matching for it.
The text was updated successfully, but these errors were encountered: