-
-
Notifications
You must be signed in to change notification settings - Fork 391
Open
Labels
enhancementNew feature or requestNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)priority.normalA normal priority topicA normal priority topic
Milestone
Description
This extension is able to detect usage of undefined global variables:

However, setfenv is used on this function to define the missing variable, but at another point in the code that the parser can't detect. Is it possible to somehow tell the parser to ignore this diagnostic? Something like:
local block = function(_)
-- env: {block, assert, error}
block()
endThen it would accept those values? I know you can define globals for the project, but this doesn't affect the entire project, only those functions, so it would be cool if you could define it somehow.
Alternatively, could we just disable the diagnostic?
local block = function(_)
-- disable: undefined-global
block()
endI don't know if the parser supports reading comments like that, let me know if that won't work or if you have better ideas for it.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)priority.normalA normal priority topicA normal priority topic