lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

wrong completion item label

Open glepnir opened this issue 1 year ago • 0 comments

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Completion

Expected Behaviour

correct label value.

Actual Behaviour

missing ].

Reproduction steps

buffer content

local context = {}

context.snippets = {}

context.snippets[ft][!] <-- ! mean cursor in there

type # will get +1 snippet item but label missing ].

Additional Notes

result of lua_ls

{
  isIncomplete = false,
  items = { {
      insertTextFormat = 2,
      kind = 15,
      label = "#context.snippets[ft]+1",
      sortText = "0001",
      textEdit = {
        newText = "#context.snippets[ft]+1] = ",
        range = {
          ["end"] = {
            character = 23,
            line = 4
          },
          start = {
            character = 21,
            line = 4
          }
        }
      }
    } }
}

note simply table insert works correct like local t = {} t[!] . result label is #t + 1]

Log File

No response

glepnir avatar Nov 05 '23 10:11 glepnir