LuaLS / LuaLS/lua-language-server
Incorrect folding range when a function with an inline comment follows an annotation
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Lua
- Sterne
- 4.4k
- Forks
- 442
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Formatting
Expected Behaviour
The folding chevron will be next to the function declaration and will fold the function.
Actual Behaviour
The folding chevron is next to the annotation and will only fold the one line of the function, leaving the rest of the function unfolded.
Reproduction steps
This code reproduces it:
---@param bar integer function foo(bar) -- comment local whee = bar + 3 return whee end
Additional Notes
Removing the inline comment fixes it.
Putting a blank line between the annotation and the function declaration line, even if it still has the inline comment, fixes it.
Log File
I couldn't get the thing to upload it, I'm sorry :(
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Faltverhalten mit dem Lua-Snippet im Issue zu reproduzieren, und vergleiche es mit den Varianten, die den Inline-Kommentar entfernen oder eine leere Zeile hinzufügen. Verfolge die Behandlung des Folding-Ranges für eine Annotation, auf die eine Funktionsdeklaration folgt. Fertig ist es, wenn der Folding-Pfeil neben der Funktionsdeklaration steht und den gesamten Funktionskörper faltet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- lua
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100