redhat-developer / redhat-developer/vscode-java
Find references on annotation attributes should not take annotated type into account
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
I have a class starting like this:
@Controller
@RequestMapping("/owners/{ownerId}")
@Profile("cloud")
class PetController {
It looks like executing Go To References while clicking on the annotation attributes uses the annotated type as the element to find references for - which should not be the case in my opinion.
Example:
- clicking on
@Controllerand executingGo To Referencesshows all references to theControllertype. 👍 - same for
@Profileetc. 👍 - clicking on
PetControllerand executingGo To Referencesshows all the references to thePetControllertype. 👍
But:
- clicking on the
"cloud"annotation attribute and executingGo To Referencesshows all the references to thePetControllertype as well. 😱 This should return no references, I think.
Background:
We have functionality in place in the Spring Tools that finds references to that specific "cloud" attribute in your code, but the results gets merged with references to the PetController type, which is not a great result (at least from what we are trying to achieve) 😀
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Go To References behavior in VS Code Java using the annotation example, starting from the reference-search handling for annotation attributes. Verify that selecting "cloud" does not include PetController type references, while selections on @Controller, @Profile, and PetController retain their expected results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100