LuaLS / LuaLS/lua-language-server

"Expand Selection" doesn't expand to strings or scopes

オープン
#3,455 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Lua
スター
4.4k
フォーク
442
PR マージ指標
30日以内にマージされた PR はありません

説明

I use VScode's "Expand Selection" command a lot to copy strings around, but when I try to use it on Lua strings, it expands the selection a lot more than just the string I'm on.

Actual behavior

Suppose my cursor is inside the word example:

hs.alert(prefix .. " an exam|ple string " .. suffix)

1st call to Expand Selection selects the word:

hs.alert(prefix .. " an example string " .. suffix)

2nd call to Expand Selection selects everything between () instead of the full string:

hs.alert(prefix .. " an example string " .. suffix)

Expected behavior

2nd call to Expand Selection should select just the string:

hs.alert(prefix .. " an example string " .. suffix)

In JavaScript, I noticed it even has two steps for the string, the inner part of the string, then the outer:

alert(prefix + " an example string " + suffix)

alert(prefix + "an example string" + suffix)

alert(prefix + " an example string " + suffix)

That would also work!

Similar scenarios

Scopes are also currently skipped:

local myFunction = function () ret|urn true end

local myFunction = function () return true end <- 1st call selects the word

local myFunction = function () return true end <- expected: 2nd call selects the function scope

local myFunction = function () return true end <- actual: 2nd call selects the line instead

Same for Object.property:

Object.property = true

Object.property = true <- expected

Object.property = true <- actual

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず Expand Selection の実装と、選択範張をカバーしているテストをすべて見つけてください。この issue では特定のファイルやエントリーポイントは指定されていません。Lua の文字列、関数スコープ、Object.property の例を再現し、その後、連続する展開によって期待される構文要素が選択されることを示すカバレッジを追加してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
lua
領域
devtools, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
65/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。