Skip to content

Goto autocompletion doesn't respect Editor: Insert Spaces setting #2041

Open
@C3pa

Description

@C3pa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestupstreamA topic related to an upsteam piece of software, not the language server directly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions