Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,455 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
lua
Ambito
devtools, tooling

Direzione di ricerca

Inizia individuando l’implementazione di Expand Selection e tutti i test che coprono l’espansione della selezione; l’issue non indica file o punti di ingresso specifici. Riproduci gli esempi di stringhe Lua, ambito di funzione e Object.property, quindi aggiungi la copertura che mostri che le espansioni successive selezionano i costrutti attesi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Lua
Stelle
4.4k
Fork
442
Merge medio
8g 9h
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LuaLS/lua-language-server

Tutte le issue di LuaLS/lua-language-server

Issue simili

Altre issue su Lua

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.