lua-language-server
lua-language-server copied to clipboard
Autocompletion is not offered for a parameter with a `@class` type
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
When using a defined class as the type for a parameter, the fields of that table should be offered as an autocompletion when calling the function.
For an example, using @alias works like so:

Actual Behaviour
No autocompletion is automatically offered when using @class as the type for a parameter. If you press CTRL + Space, you can make the completions appear, but they will not appear automatically.
Nothing is offered:
Until I press CTRL + Space:

Reproduction steps
- Use the below code:
---@class Options ---@field page number ---@field active boolean ---@param opts Options local function acceptOptions(opts) end acceptOptions() - Move your cursor to line 9 (
acceptOptions()) and place it between the parentheses
- Enter
{to start a table literal - No completions are offered
- Press CTRL + Space and notice that the first 2 options are actually proper completions from the
Optionsclass. These should automatically be offered.
Additional Notes
No response
Log File
No response