LuaLS / LuaLS/lua-language-server
Adding global definitions always indents with 4 spaces
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
Which OS are you using?
Windows
Expected Behaviour
When I use the VSCode function to define a variable as allowed global, it should re-use the formatting of the existing file (luarc.json) when adding it.
Actual Behaviour
It always uses 4 spaces, instead of the 2 the file uses.
Reproduction steps
- Have a global in your file
- Have a .luarc.json file in your project
- Have the LSP complain about it being global
- Use the VSC action to mark it as defined
Additional Notes
Log
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 tracing the VSCode action that adds an allowed global to .luarc.json, then inspect how the existing file's indentation is read or preserved. Reproduce the issue with a file using two-space indentation and confirm that marking a global as defined keeps that formatting rather than inserting four spaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100