Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

lsp.client: no per-file server binding (project×mime only), and rename merges WorkspaceEdits from every bound server

オープン
#9,582 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
java

調査の方向性

まず ide/lsp.client、特に LSPBindings と SPI である LanguageServerProvider.startServer を読み、次に lookupAll バインディングから WorkspaceEdits をマージする rename の経路を追跡します。1 つの MIME に対して 2 つの provider を登録して問題を再現し、選択した設計がファイルごとの binding、または単一の権威ある rename サーバーをサポートし、重複した編集を適用しないことを確認します。

索引モデルが issue の本文から書いたものです。

説明

LSP
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 setMIMEType reroutes 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.

主要言語
Java
スター
3.1k
フォーク
939
平均マージ
4日 21時間
マージ済み PR(30日)
24

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/netbeans のほかの issue

apache/netbeans の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。