LuaLS / LuaLS/lua-language-server
"Expand Selection" doesn't expand to strings or scopes
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Lua
- Star
- 4.4k
- Fork
- 442
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
examplestring " .. 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
examplestring " + 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 ()
returntrue 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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách xác định phần triển khai của Expand Selection và mọi bài kiểm thử bao quát việc mở rộng vùng chọn; issue không nêu tên các tệp hoặc điểm vào cụ thể. Tái hiện các ví dụ về chuỗi Lua, phạm vi hàm và Object.property, sau đó bổ sung coverage cho thấy các lần mở rộng liên tiếp chọn đúng các cấu trúc mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- lua
- Lĩnh vực
- devtools, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 65/100