Open goldenstein64 opened 3 years ago
In my color theme (Atom One Dark), this would greatly help discern between keywords and library functions:
I wrote this in consideration of the vscode repository's existing Lua syntax highlighter (L234-237):
{ "match": "(?<![^.]\\.|:)\\b(coroutine\\.(create|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\\.(concat|insert|maxn|remove|sort)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(cpath|loaded|loadlib|path|preload|seeall)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|traceback))\\b(?=\\s*(?:[({\"']|\\[\\[))", "name": "support.function.library.lua" },
It would also help to use constant highlighting for math.pi and math.huge like vscode repo does (L222-225), or just remove it altogether:
math.pi
math.huge
{ "match": "(?<![^.]\\.|:)\\b(false|nil|true|_G|_VERSION|math\\.(pi|huge))\\b|(?<![.])\\.{3}(?!\\.)", "name": "constant.language.lua" },
Although I would probably make the name of those two constant patterns support.constant.luau.
support.constant.luau
Will look into better support for other themes.
In my color theme (Atom One Dark), this would greatly help discern between keywords and library functions:
I wrote this in consideration of the vscode repository's existing Lua syntax highlighter (L234-237):
It would also help to use constant highlighting for
math.pi
andmath.huge
like vscode repo does (L222-225), or just remove it altogether:Although I would probably make the name of those two constant patterns
support.constant.luau
.