monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Feature Request] Add documentSelector to MonacoLspClient

Open tamayika opened this issue 1 year ago • 1 comments

Context

  • [x] This issue is not a bug report. (please use a different template for reporting a bug)
  • [x] This issue is not a duplicate of an existing issue. (please use the search to find existing issues)

Description

MonacoLspClient does not support documentSelector(like https://code.visualstudio.com/api/references/vscode-api#DocumentSelector). This results that all models in monaco editor is synchronized by LSP and sends unnecessary change events to LSP servers.

Monaco Editor Playground Link

N/A

Monaco Editor Playground Code

N/A

tamayika avatar Nov 25 '25 08:11 tamayika

I'd like to work on this. TextDocumentSynchronizer currently syncs every model (onDidCreateModel / getModels) and ignores the documentSelector from the dynamic registration options, while LspDiagnosticsFeature already uses matchesDocumentSelector. I can open a PR that filters models by the registration's documentSelector, with tests. Would that approach be welcome?

aaka3h avatar Oct 24 '26 00:10 aaka3h