-
-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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?
Diagnostics/Syntax Checking
Expected Behaviour
If I include _ENV as a parameter, the extension should identify _ENV as properly defined. No errors should occur with the below code:
local function foo(_ENV)
Joe = "human"
end
Actual Behaviour
I am getting an error message:
Invalid global (_ENV
is nil
).Lua Diagnostics.(global-in-nil-env)
Reproduction steps
- Create a function which takes _ENV as a parameter
- Assign an undefined variable
- The undefined variable is throwing a Lua server error.
Additional Notes
This can be worked around via adding a "diagnostic disable" or by adding "local _ENV = _ENV" (which are both very ugly hacks).
Log File
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working