Repository navigation
refactor: deprecate LSPDocumentSymbolFeature.matchesPsiElement, which the Structure view no longer needs - #2288
Merged
lagergren merged 1 commit intoNov 26, 2026
Conversation
… the Structure view no longer needs Since 0.20.0 (redhat-developer#1531), the Structure view selects the DocumentSymbolData that contains the caret, and compares document symbols with each other. Matching a document symbol with a PSI element is reached only when a symbol is compared with the file's PsiFile. The method is deprecated for removal, and still called by DocumentSymbolData.equals, so a client that overrides it keeps its behaviour in this release. Making equals compare document symbols only follows in redhat-developer#2285. Part of redhat-developer#2285
This was referenced Nov 26, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2288 +/- ##
==========================================
- Coverage 58.43% 58.42% -0.02%
==========================================
Files 846 846
Lines 36455 36455
Branches 7545 5721 -1824
==========================================
- Hits 21304 21300 -4
- Misses 12152 12154 +2
- Partials 2999 3001 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action not completed
|
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.
Deprecates
LSPDocumentSymbolFeature.matchesPsiElementfor removal. Nothing changes in behaviour:DocumentSymbolData.equalsstill calls it, so a client that overrides it keeps its behaviour in this release, and gets a deprecation warning before it stops being called.Why
Since 0.20.0 (#1531), the
Structureview selects theDocumentSymbolDatathat contains the caret, becausefindAcceptableElementreturns it.StructureViewComponent.visitPathForElementSelectionthen compares document symbols with each other; this was checked in the bytecode of 2024.2 and 2026.3. Matching a document symbol with a PSI element, which this method does forequals, is reached only when a symbol is compared with the file'sPsiFile. See #2285.Changes
@Deprecated(since = "0.30.2", forRemoval = true)and an@deprecatedJavadoc onmatchesPsiElement, in the style of the other deprecations of 0.30.0.DocumentSymbolData.equalskeeps calling it, with@SuppressWarnings("removal")and a comment saying why.docs/LSPApi.mdmarks the method deprecated.matchesPsiElementis public API with no deprecationThe next step, for 0.31.0 in #2285: tests that pin the Structure view's selection, then an
equalsthat compares document symbols only, after which this method is no longer called.Part of #2285