-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
[Suggestion] Add ability to define an enum without using a table #2721
Comments
Good capture, this is something that has also bothered me a lot, and I agree with this new type of annotations |
Implementing this requirement would be the same as supporting setfenv, which seems unlikely at the moment. |
How so? |
This functionality would be very helpful to me. This is one of the few areas where LuaLS feels like it's missing an obvious feature |
I'll duplicate the message from luttje/glua-api-snippets#71 (comment) here so that people can use it
|
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Annotations, Type Checking, Completion
Suggestion
For existing codebases where enums are defined like this:
it would be nice to be able to define all lines that follow (until the next blank line) as part of an enum without changing anything by introducing a table: i.e.
This would be convenient for type annotating when the values are passed as parameters and what-not. I'm not able to find any existing ways to designate these values as a "group" (or union) that maintains their use as global constants.
The text was updated successfully, but these errors were encountered: