LuaLS / LuaLS/lua-language-server
wrong completion item label
Open
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?
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
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 completion issue in NeoVim with the provided Lua buffer and inspect LuaLS handling of table-index completion and snippet labels. Compare the returned label with the textEdit newText; done means the completion item label includes the missing closing bracket while preserving the existing insertion behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100