Skip to content

Don't register ability to hover, request colors, etc… more than once #1378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 20, 2025

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented May 20, 2025

We're currently re-registering "common" capabilities per workspace folder. This causes VSCode to make multiple requests to the server for things like hover causing higher CPU usage. This then results multiple hovers being displayed. What's worse is that for some scenarios where the server has to internally do a restart the old registrations weren't getting disposed of because of a race condition when calling it concurrently for multiple folders.

I've done two things to address this:

  • Common capability registration will only happen after all project folders have been initialized — hopefully this doesn't cause any problems (though if it does it's revealing a bigger underlying one)
  • Common capabilities will be explicitly disposed before registering again

This should mean that this only happens one time per server initialization.

Fixes #1371

@thecrypticace thecrypticace merged commit 8170e66 into main May 20, 2025
12 checks passed
@thecrypticace thecrypticace deleted the fix/duplicate-capabilities branch May 20, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop of loading IntelliSense Issue in Monorepo folders .code-workspace
2 participants