Uh oh!
There was an error while loading. Please reload this page.
Add find references support for constants - #2632
Conversation
andyw8
commented
Sep 30, 2024
Do we need any safeguards for someone running Find References on a large codebase for some constant with a high number of occurrences? |
andyw8
left a comment
There was a problem hiding this comment.
Very exciting to have this.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
8d1136c to
6b96c8cCompareI found one issue: Create a new file, but don't save it: classWidget2defbarendendWidget2Right-click on The LSP will error with: |
b706ba9 to
39d4757Comparef15a0af to
ae8a87aCompare39d4757 to
933a025Comparevinistock
commented
Oct 1, 2024
The issue was related to not finding a target. I fixed it in the latest push. |
21f56af to
377e988Compare933a025 to
4274afdCompare
Motivation
Closes#202
With the same infrastructure added in #2626, we can easily support finding constant references. Instead of building an array of text edits, we just return an array of locations.
Implementation
The idea is to use the same reference finder implementation and then return all of the hits back as locations.
I also had to fix a small duplication issue to be able to respect the LSP spec's
includeDeclarationparameter.Automated Tests
Added tests.