LuaLS / LuaLS/lua-language-server
Autocompletion is not offered for a parameter with a `@class` type
Nessuno ha ancora preso questa issue.
- Lingua principale
- Lua
- Stelle
- 4.4k
- Fork
- 442
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### 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
1. Use the below code:
```lua
---@class Options
---@field page number
---@field active boolean
---@param opts Options
local function acceptOptions(opts) end
acceptOptions()
```
2. Move your cursor to line 9 (`acceptOptions()`) and place it between the parentheses

3. Enter `{` to start a table literal
4. No completions are offered
5. Press CTRL + Space and notice that the first 2 options are actually proper completions from the `Options` class. These should automatically be offered.
### Additional Notes
_No response_
### Log File
_No response_
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Nell’issue non viene indicato alcun file sorgente né alcun test. Inizia eseguendo la riproduzione Lua fornita nell’estensione VS Code e traccia il comportamento del completamento dopo aver inserito `{` per il parametro `Options`; il lavoro è completato quando i campi `@class` vengono proposti automaticamente senza premere Ctrl+Space.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- lua
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100