-
Notifications
You must be signed in to change notification settings - Fork 39.5k
Improve lua grammar #140489
Copy link
Copy link
Closed
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitygrammarSyntax highlighting grammarSyntax highlighting grammarverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded
Milestone
Metadata
Metadata
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalitygrammarSyntax highlighting grammarSyntax highlighting grammarverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded
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.