LuaLS / LuaLS/lua-language-server
"Expand Selection" doesn't expand to strings or scopes
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Lua
- Estrellas
- 4.4k
- Forks
- 442
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza localizando la implementación de Expand Selection y cualquier prueba que cubra la expansión de la selección; el issue no nombra archivos ni puntos de entrada específicos. Reproduce los ejemplos de cadenas de Lua, ámbito de función y Object.property, y luego añade cobertura que muestre que las expansiones sucesivas seleccionan las construcciones esperadas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- lua
- Área
- devtools, tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 65/100