LuaLS / LuaLS/lua-language-server
Unexpected `textDocument/references` results on keys inside nested tables
オープン
まだ誰も着手していません。
enhancement
- 主要言語
- Lua
- スター
- 4.4k
- フォーク
- 442
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Describe the bug
textDocument/references is returning unexpected results when used in a specific situation (more about that below).
To Reproduce
- Paste the following snippet in a lua file
ENUM = {
VALUE1 = 1,
VALUE2 = 2,
}
a = {
{ type = ENUM.VALUE1 },
{ type = ENUM.VALUE1 },
{ type = ENUM.VALUE2 },
}
- Move cursor over the 1st instance of
"type"key in theatable - Request references (
textDocument/references) - Observe the faulty results which comprise of the hovered
"type"key + both instances of"VALUE1"
Expected behavior
Results that comprise of all 3 instances of "type" key
Additional context
textDocument/rename on the other hand only renames the hovered "type" key while expected to rename all 3 of its instances
Environment
- OS: Linux
- Client: Neovim
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
示されているネストしたテーブルの例を使って Lua ファイルで問題を再現し、最初の型キーに対して textDocument/references を要求します。返された位置を textDocument/rename の動作と比較します。references に3つすべての型キーが含まれ、VALUE1 や VALUE2 が含まれていなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- lua, neovim
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100