Giter Club home page Giter Club logo

vscode-luau's Issues

Change luau.tmLanguage.json library function pattern name to support.function.library.luau

In my color theme (Atom One Dark), this would greatly help discern between keywords and library functions:

Lua Luau
image image

Some color themes are better at making this difference noticeable, like default Dark+:

Lua Luau
image image

And some others are not, like Material Darker:

Lua Luau
image image

or VS Dark:

Lua Luau
image image

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:

{
	"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.

Incompatible with the Selene VSCode extension

This extension uses a special language id (luau) in the package.json contributions instead of the normal "lua" language id that other extensions use, such as the VSCode extension for Selene. This make the extension incompatible with Selene for linting.

Incorrectly marking valid code as invalid

I've seen it mark this stuff as wrong when it's actually valid Luau code:

  • Type checking

image

  • The += & -= operators

image

That code is all valid Luau (runs fine in-game and in studio)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.