LuaLS / LuaLS/lua-language-server
For loop with negative step: false positive
- 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?
NeoVim
### Which OS are you using?
Windows WSL
### What is the issue affecting?
Diagnostics/Syntax Checking
### Expected Behaviour
Warning shouldn't be displayed
### Actual Behaviour
Warning is displayed
### Reproduction steps
```lua
local r = 1
for x = -r, 1 do
print(x)
end
```
### Additional Notes
Tested on 3.13.2.

### Log File
I am using nvim + mason, and it does not save any logs even with command line arguments.
Contributor guide
Research direction
Run the provided Lua snippet in LuaLS 3.13.2 through the reported Neovim setup and confirm the diagnostic under Diagnostics/Syntax Checking. Trace how numeric for loops are analyzed, then verify that this valid loop no longer produces the warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100