LuaLS / LuaLS/lua-language-server
Lazy load workspace libraries
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Lua
- Sterne
- 4.4k
- Forks
- 442
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I'm using sumneko_lua with Neovim and I wanted to have completions from the Lua plugins I have installed, so I inserted all the paths to the plugins that I have into Lua.workspace.library
But the problem is that it that sumneko_lua loads all the files inside those libraries right on startup, causing a massive increase to my RAM usage. Normally sumneko_lua only takes up 100-200 MB, but after adding 40+ library paths, sumneko now takes up to 600-700 MB.
Is it possible to load the libraries into the workspace, only when it is needed?
For example, I don't believe the library needs to be loaded when you're only completing a require statement:
local foobar = require("foob|
sumneko_lua only needs to scan the directories listed in Lua.workspace.library to find the correct files.
Once the require statement is completed, and its return value is interacted with:
local foobar = require("foobar")
foobar.call_functi|
sumneko_lua can now then load the library in order to produce the completions.
Is it possible for something like this to be implemented?
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 nachzuverfolgen, wie Lua.workspace.library-Pfade geladen werden und wie die Vervollständigung von require-Anweisungen passende Dateien findet. Untersuche anschließend, wann die erforderliche Bibliothek für Member-Vervollständigungen verfügbar wird. Als abgeschlossen gilt die Aufgabe, wenn Bibliothekspfade durchsucht werden, ohne beim Start jede Datei zu laden, während Vervollständigungen wie require("foobar") und foobar.call_function weiterhin funktionieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- lua, neovim
- Bereich
- devtools, performance
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100