You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Expand Selection" doesn't expand to strings or scopes #3455
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
Activity
[-]"Expand Selection" doesn't select full strings[/-][+]"Expand Selection" doesn't expand to strings or scopes[/+]