microsoft / vscode-languageserver-node

Language server protocol implementation for VSCode. This allows implementing language services in JS/TS running on node.js
MIT License
1.41k stars 320 forks source link

Extra semanticTokens requests in a multiroot workspace #1487

Open andyw8 opened 1 month ago

andyw8 commented 1 month ago

:wave:

I'm a maintainer on Ruby LSP.

I have a multiroot repo with two apps, app1 and app2. https://github.com/andyw8/multiroot_monorepo

While a file from app1 is open, the logs show all requests going to app1, as expected, except for one type of request, semanticTokens:

Screenshot 2024-05-29 at 12 06 39 PM

This happens even if I have no files from app2 open.

Is there something special about semanticTokens that might cause it to behave that way?

(I can provide further information to help troubleshoot, but wanted to ask this up-front in case there's a simple answer).

cc @vinistock

vinistock commented 1 month ago

Worth pointing out that the Ruby LSP spawns separate language servers for each configured workspace. Each one of the clients has their document selector configured to only handle requests for the specific workspace they are related to.

All other requests work as expected: each language server only receives requests for files that are inside their workspace. Except for semantic highlighting, which seems to be sent to all servers despite the document selector.