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()
end
Then 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()
end
I 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.
This extension is able to detect usage of undefined global variables:

However,
setfenvis 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:Then 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?
I 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.