LuaLS / LuaLS/lua-language-server
false positive in undefined-field
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
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
```lua
function F()
G = 1
end
function F2()
G = { a = 1 }
end
F()
F2()
print(G.a)
```
expected no error
### Actual Behaviour
but got an error

### Reproduction steps
enable vscode extension
### Additional Notes
_No response_
### Log File
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the snippet in the Visual Studio Code extension on Windows with diagnostics and syntax checking enabled. Trace the undefined-field diagnostic for the global G across F and F2, then verify that the example no longer reports an error after the behavior is corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100