Repository navigation
fix: give a document opened from workspace/textDocumentContent the features of its server - #2028
Merged
lagergren merged 2 commits intoNov 20, 2026
Conversation
…atures of its server Fixes redhat-developer#2026 LanguageServersRegistry.isFileSupported left out every LightVirtualFile outside the local file system, so a DocumentContentFile, which the server has open under its own URI, got no Go to Definition, hover, highlighting or other feature. It is now supported. MarkdownConverter no longer needs a parent folder of the file for relative links, which such a document doesn't have.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2028 +/- ##
==========================================
+ Coverage 49.17% 49.23% +0.05%
==========================================
Files 813 813
Lines 33095 33101 +6
Branches 6771 6774 +3
==========================================
+ Hits 16276 16297 +21
+ Misses 14275 14249 -26
- Partials 2544 2555 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…cached value A document opened from workspace/textDocumentContent is a LightVirtualFile, which holds its PSI. The provider of EditorBehaviorFeature's cached value captured the file, which IntelliJ 2026.3's leak check reports as retaining PSI once such a document gets the features of its server. A file without a VFS id is now checked each time.
Collaborator
Author
|
@coderabbitai review |
Action performed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2026
A document that a language server provides with
workspace/textDocumentContent(#1749) is open on that server under its own URI, butLanguageServersRegistry.isFileSupportedleft it out with every otherLightVirtualFileoutside the local file system (#782). So Go to Definition, hover, highlighting, folding, semantic tokens and the other features sent no request in it.isFileSupported, in both of its forms, now takes aDocumentContentFile. Other light files are still left out.EditorBehaviorFeatureno longer caches its flags for a file without a VFS id: the provider of the cached value captured the file, and a light file holds its PSI, which IntelliJ 2026.3's leak check reports once such a document gets features.MarkdownConverterno longer assumes that the file has a parent folder to resolve relative links against. ADocumentContentFilehas none, and its hover threw aNullPointerExceptiononce the check passed.Tests
DocumentContentNavigationTest:testGoToDefinitionWorksInTheContentOfTheServerasks Go to Declaration in an open server document, as IntelliJ does, and gets the target in another document of the server. It fails without the fix: no target.testDocumentationRendersInTheContentOfTheServerrenders markdown with a relative link for a server document. It fails without the fix with theNullPointerException../gradlew test: 1732 tests, 0 failures, 7 skipped (the Windows-only and inline completion tests that are skipped onmain). TheDocumentContenttests also pass on IU 2026.3 (-PplatformVersion=2026.3 -PplatformType=IU); without theEditorBehaviorFeaturechange,testGoToDefinitionWorksInTheContentOfTheServerfails there with the leak check.Checked in xtclang/xvm's IntelliJ playbook with this build: in a library source that Go to Definition opened from the server, Go to Definition on a call now goes to the method in another source of the library, with no IDE errors, in 2 of 2 runs. With 0.30.1 it does nothing.