lsp.client: no per-file server binding (project×mime only), and rename merges WorkspaceEdits from every bound server
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- developer-experience, tooling
Direzione di ricerca
Inizia leggendo ide/lsp.client, in particolare LSPBindings e la SPI LanguageServerProvider.startServer, quindi segui il percorso di rename che unisce i WorkspaceEdits dei binding di lookupAll. Riproduci il problema con due provider registrati per un MIME e verifica che il design scelto supporti un binding per file oppure un unico server di rename autorevole, senza applicare modifiche duplicate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Apache NetBeans version
Apache NetBeans 25 (observed on RELEASE300, still present on RELEASE310)
Bug description
Two related limitations in ide/lsp.client that together make it impossible to attach a language server to a subset of files sharing a MIME type — and make it hazardous for two servers to share a mime at all:
1. Bindings are per PROJECT × MIME, never per file. LSPBindings keys server bindings by (project, mime). LanguageServerProvider.startServer receives no file/document context, so a provider cannot decide per file whether to attach. Concrete case: Angular CLI ≥ 21 generates suffixless templates (widget.html beside widget.ts), which want the Angular Language Service — but binding ngserver under text/html attaches it to every html file in the project, plain documents included.
2. Rename applies WorkspaceEdits from EVERY bound server. When two servers are bound to one mime (which lookupAll deliberately allows — useful for eslint-style diagnostic servers), the platform's rename collects and applies edits from all of them. With two servers that both implement rename (e.g. ngserver beside typescript-language-server on text/typescript), every rename is applied twice — we measured real double-renames before suppressing one server's mime binding entirely.
Also worth noting: the bindings consult the FileObject's resolver-assigned mime, not the document mime — a DataObject that pins the editor content type via the public CloneableEditorSupport.setMIMEType gets the full editor surface (coloring, keybindings, popup) for the new mime, but LSP still binds by the file mime, so the two disagree.
Steps to reproduce
For (2): register two LanguageServerProviders for one mime where both back rename; rename a symbol; observe the edit applied twice.
For (1): attempt to attach a server to only those text/html files matching a project-structural condition — there is no seam: startServer has no file, and mime-folder registration is all-or-nothing per project.
Expected behavior
Either of these would unblock the use case safely:
- a per-file consultation in the provider SPI (e.g. the provider sees the triggering FileObject/document and may decline), or
- bindings consulting the document mime (so
setMIMETypereroutes LSP together with the editor surface), or - rename asking one authoritative server per capability instead of merging all bindings' edits.
Context
Found while building NMOX Studio (Apache-2.0, NetBeans-Platform based): https://github.com/NMOX/NMOX-Studio — engineering ledger entries 81/82 (docs/engineering/tech-debt.md) carry the measurements and the decompiled details. Related: #9581 (multi-mime provider registrations and the instance-keyed reuse map). Happy to test patches or provide more detail.
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 939
- Merge medio
- 5g 12h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/netbeans
-
Contribution welcome kind:feature Platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/netbeans#9614 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
kind:bug LSP needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/netbeans#9548 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Editor Java kind:feature needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
The main Options dialog window has buttons with OK on the left instead of on the right on LinuxApertakind:bug needs:triage os:linux os:macos Platform UI
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
kind:bug needs:triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/netbeans
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
portfolio-performance/portfolio#6119 ·
I maintainer di solito rispondono entro 8 giorni
-
Bump up AWS SDK to 2.54.3Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
jenkinsci/ec2-plugin#2041 ·
-
L: github:actions L: php:composer
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
dependabot/dependabot-core#16493 ·
I maintainer di solito rispondono entro 1 giorno
-
SHOW EDIT of a subclass for an object of its superclass: the form fails to open with AssertionErrorAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100