LuaLS / LuaLS/lua-language-server

Any changes to the file tree are ignored

Offen
#2,234 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug filewatch
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?

Linux

What is the issue affecting?

Annotations, Type Checking, Completion, Diagnostics/Syntax Checking, Hover

Expected Behaviour

When you make any changes to the workspace's file tree (e.g. add a new file, rename a file), LuaLS becomes aware of them.

Actual Behaviour

New/renamed files are only recognized so long as they are open in the editor and completely forgotten about once closed.

Reproduction steps
  1. Add a new file to your existing workspace with the following content:
---@class TestClass
local TestClass = {}

function TestClass.test()
end

return TestClass
  1. Save it and close the editor tab.
  2. Require this file into a local in some other, preexisting file.
  3. Observe that the local is of unknown type.
Additional Notes

Re-running diagnostics doesn't fix this. The only workaround I have found is to completely restart VSCode.

From my limited understanding of LuaLS code, I think it has something to do with cached files. And there is no way to discard and rebuild the cache without exiting VSCode that I could find.

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 Verarbeitung von Änderungen am workspace file-tree durch LuaLS und den im Report erwähnten cached-file-Lebenszyklus nachzuverfolgen. Reproduziere anschließend die bereitgestellte Sequenz aus add, save, close und require und überprüfe dann, dass diagnostics die neue oder umbenannte Datei nach dem Schließen erkennen, ohne VS Code neu zu starten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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