LuaLS / LuaLS/lua-language-server
Wrong edit range for param completions
まだ誰も着手していません。
- 主要言語
- Lua
- スター
- 4.4k
- フォーク
- 442
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Completion
Expected Behaviour
For parameters that can either be a single value or a list T|T[], when already in a table, the completion range should not include surrounding curly braces.
Actual Behaviour
The completion edit range provided by lua-language-server for parameters seems to always include the entire parameter, which causes issues when completing params that can be either a single value or a list, for example, T|T[].
Reproduction steps
- Create
test.luain the test dir with the following content:---@alias my_type 'a'|'b' ---@param arg my_type|my_type[] local function test_func(arg) return arg end - Use neovim to edit
test.lua - Try to call
test_funcat the end of the file with a list parameter:test_func({ ... }) - Completions provided by lua-language-server are shown inside the curly braces
- Selecting one of the completions replaces the whole parameter, including the surrounding curly braces.
https://github.com/user-attachments/assets/d69214e9-b069-4554-b4ab-770e2fb50632
Additional Notes
I have also reported to the blink.cmp but the maintainer thinks that it is a lua-language-server's issue: https://github.com/Saghen/blink.cmp/issues/2179
Log File
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
test.lua の例と Neovim を使って問題を再現し、my_type|my_type[] 型のパラメータに対する補完の編集範囲に焦点を当てます。引数が波括弧内にある場合に、補完範囲がどのように計算されるかを追跡します。補完を選択すると波括弧内の値だけが置き換えられ、周囲のリスト構文が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- lua, neovim
- 領域
- developer-experience, tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 58/100