LuaLS / LuaLS/lua-language-server
Goto autocompletion doesn't respect Editor: Insert Spaces setting
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?
Completion
Expected Behaviour
As can be seen in the images below, the autocompletion of goto continue will indent the ::continue:: line with four spaces, while my settings have Editor: insert spaces unchecked, which means it should insert a tab character instead.
Actual Behaviour
Note: in these images, the tab character is rendered as an arrow, while spaces are rendered as dots.
Image 1 
Image 2 

Reproduction steps
- In VSCode, set your Editor: Insert Spaces setting to false
- Try the following code:
local arr = {}
for k,v in pairs(arr) do
if type(k) == "string" then
goto continue
end
::continue::
end
- When you start typing goto continue, and select the popup, you'll get the four spaces indentation instead of tab on the
::continue::line.
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 goto completion behavior in the VS Code extension with Editor: Insert Spaces disabled and the Lua snippet shown, then trace the completion path. Done means selecting goto continue indents the label with a tab character rather than spaces when that setting is disabled.
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
- 45/100