LuaLS / LuaLS/lua-language-server

Adding a new workspace folder breaks things

Offen
#1,974 10 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug Info Needed
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?

Windows

What is the issue affecting?

Completion, Diagnostics/Syntax Checking, Hover, Libraries

Expected Behaviour

Addding new workspace folders should not break anything.

Actual Behaviour

Right now, adding a new workspace folder breaks two things, diagnostics and require statements:

  • You can fix the diagnostic errors by hooking to the workspace/diagnostic/refresh handler to manually refresh it, but even then this is very unreliable and prone to not working:
    https://github.com/neovim/nvim-lspconfig/issues/2366

  • require statements that refers to modules in the new workspace folder also does not resolve correctly (hovering over the module string will display the byte length, instead of the resolved path). This means that completions from the required module will also be missing. So far I can't find any way to fix this without restarting neovim entirely.

Other LSP servers doesn't have this problem. Adding a new workspace folder should just work without any additional steps.

Reproduction steps
  1. Initialize the LSP server with a root directory
  2. Add a new workspace folder using workspace/didChangeWorkspaceFolders
  3. Opening a file from that workspace folder results in diagnostic errors and modules not being resolved correctly
Additional Notes

No response

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

Beginne damit, die gemeldete Abfolge zu reproduzieren: Initialisiere mit einem Stammverzeichnis, sende workspace/didChangeWorkspaceFolders und öffne eine Datei im hinzugefügten Ordner. Untersuche anschließend, wie sich workspace/diagnostic/refresh und die Auflösung von require-Modulen verhalten. Als abgeschlossen gilt die Untersuchung, wenn Diagnosen, Hover-Pfade und Vervollständigungen im neuen Workspace funktionieren, ohne Neovim neu zu starten oder auf manuelle Aktualisierungen angewiesen zu sein.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua, neovim
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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