LuaLS / LuaLS/lua-language-server
Line with just a space in gitignore causes whole project to be ignored
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
An empty space (literally just ` `) along with `"Lua.workspace.useGitIgnore" : true` being set seems to be causing my whole project to be ignored.
### Actual Behaviour
I'd expect it to be ignored. The `.gitignore` docs (https://git-scm.com/docs/gitignore#_pattern_format) say:
> Trailing spaces are ignored unless they are quoted with backslash ("\").
### Reproduction steps
1. Assign global in `a.lua`: `x = 100`
2. Add `.gitignore` with empty space character
3. See below:
Removing the `.gitignore` file fixes the issue.
### 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
Reproduce the behavior with the `Lua.workspace.useGitIgnore` setting enabled, a `.gitignore` containing only a space, and the `a.lua` assignment described in the issue. Trace the gitignore handling used by diagnostics and verify that a whitespace-only line is ignored without causing the whole project to be ignored.
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
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100