LuaLS / LuaLS/lua-language-server

Possiblity to share woring context between lua-langserver instances

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

Dieses Issue hat noch niemand übernommen.

question
Vorherrschende Sprache
Lua
Sterne
4.4k
Forks
442
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi there!
I have an usecase that can looks strange for some people, but still it is important for me.
It leads me to the situation, that sometimes I have multiple instances of editor (neovim), running at the same time, and redacting different files in same project(s).

That leads to the situation, that each such instance runs lua_ls, then each lua_ls loads workspace (and eats few gigabytes RAM. Each.).
And, actually all that lua_ls instance in fact doing the same work at the same time.

// by the way, sometimes som instances goes crazy and leaking memory, so sometimes I found that it ate more than 30G RAM, and even swap gone loaded up to about 20G, but I can't properly catch such situations to properly report a bug.

It would be nice if it would be possible to ask those lua_ls instances to somehow share their context, and don't redo the same work each by itself (and also to significantly reduce memory consumption).

P.S. Unfortunatelly, looks like it is impossible to solve that from the editor side (I don't think it is possible at all, to set up nvim (and even other editors) in the way to don't start own lsp servers instances inside each nvim instance, and I even not sure if it is possible to ask it to connect to servers (that supports it) over TCP.
And I'm not sure lua_ls supports tcp transport at all 🤷

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 zu untersuchen, wie lua_ls-Instanzen einen Workspace laden und wie Neovim sie startet; das Issue nennt keine Datei und keinen Test. Untersuche, ob Instanzen Kontext gemeinsam nutzen oder über TCP kommunizieren können, und betrachte die Arbeit erst dann als abgeschlossen, wenn mehrere Editor-Instanzen vermeiden, den Workspace-Zustand und die Speichernutzung zu duplizieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua, neovim
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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