Skip to content

Auto-completing quoted fields strips quotes #2088

Closed
@trumank

Description

@trumank

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Completion, Hover

Expected Behaviour

---@class Foo
---@field ['with quotes'] integer
---@field without_quotes integer

---@type Foo
local bar = {}

Auto-completing bar. -> 'with quotes' would result in bar['without quotes']

Actual Behaviour

Instead bar. -> 'with quotes' results in bar[without quotes]

Reproduction steps

Peek.2023-04-25.22-40.mp4

Additional Notes

There are also some visual bugs with the hover text for both the quoted field and the class, which are shown in the clip:

  • with quotes field hover shows Foo.nill: integer
  • bar hover shows with quotes with broken syntax highlighting

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions