LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.25k stars 305 forks source link

vscode does not list server-provided completion items. #2783

Open NeOzay opened 1 month ago

NeOzay commented 1 month ago

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

vscode displays the enum

Actual Behaviour

vscode shows no completion available, despite server response. image

Reproduction steps

---@alias Option string | "AAA" | "BBB" | "CCC"
---@param x Option[]
local function f(x)
end

f({"|"}) <- trigger completion

Additional Notes

No response

Log File

No response

tomlau10 commented 1 month ago

Strange enough, if we write f({[1] = <trigger completion>}), then it works as expected 😕

sumneko commented 4 weeks ago

VSCode will perform a secondary filter based on the submitted text and the text near the cursor to reject obviously incorrect items. I will check to see if I fell into a trap.