LuaLS / LuaLS/lua-language-server

Goto autocompletion doesn't respect Editor: Insert Spaces setting

Open
#2,041 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement upstream
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
Image 2 image
image

Reproduction steps
  1. In VSCode, set your Editor: Insert Spaces setting to false
  2. Try the following code:
local arr = {}

for k,v in pairs(arr) do
	if type(k) == "string" then
		goto continue
	end
    ::continue::
end
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.