LuaLS / LuaLS/lua-language-server

Additional blank lines are added to parameter descriptions in type annotations

Offen
#2,333 1 Kommentar 8 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Hover

Expected Behaviour

For multiline descriptions in @param annotations to be displayed as if they were in a single line.

Actual Behaviour

When the description in a @param annotation spans multiple lines, a linebreak in inserted in the Markdown response, which breaks syntax highlighting:
image

Even after removing the preceding whitespace in the example above, formatting is still off:
image

Reproduction steps
  1. Create a lua file with the following content:
---@param bar any This is the description
---           for bar.
local function foo(bar) end
  1. Hover over foo.
  2. Notice the broken highlighting/formatting in the description of bar.
Additional Notes

Although VS Code doesn't have additional syntax highlighting, do note how the font style in explanation above) changes, which suggests that the issue is reproducible outside Neovim:
image

Log File

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Problem anhand des bereitgestellten Lua-Beispiels, indem du in NeoVim oder VS Code mit dem Mauszeiger über foo fährst. Beginne bei der Hover-Antwort und dem Formatierungspfad für mehrzeilige @param-Beschreibungen; abgeschlossen ist die Aufgabe, wenn die Beschreibung als eine Zeile gerendert wird, ohne die Markdown-Syntaxhervorhebung in beiden gemeldeten Umgebungen zu unterbrechen.

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
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.