LuaLS / LuaLS/lua-language-server

Any changes to the file tree are ignored

Aperta
#2,234 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug filewatch
Lingua principale
Lua
Stelle
4.4k
Fork
442
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

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.

Direzione di ricerca

Inizia tracciando la gestione da parte di LuaLS delle modifiche al workspace file-tree e del ciclo di vita di cached-file coinvolto nella segnalazione. Riproduci quindi la sequenza fornita di add, save, close e require, poi verifica che diagnostics riconosca il file nuovo o rinominato dopo la sua chiusura, senza riavviare VS Code.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.