LuaLS / LuaLS/lua-language-server
Autocompletion is not offered for a parameter with a `@class` type
まだ誰も着手していません。
- 主要言語
- Lua
- スター
- 4.4k
- フォーク
- 442
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
issue ではソースファイルもテストも指定されていません。まず、VS Code 拡張機能で提供されている Lua の再現コードを実行し、Options パラメーターに { を入力した後の補完の動作を追跡してください。@class フィールドが Ctrl+Space を押さなくても自動的に候補として表示されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- lua
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100