redhat-developer / redhat-developer/vscode-java

Find references on annotation attributes should not take annotated type into account

Offen
#3,808 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

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 @Controller and executing Go To References shows all references to the Controller type. 👍
  • same for @Profile etc. 👍
  • clicking on PetController and executing Go To References shows all the references to the PetController type. 👍

But:

  • clicking on the "cloud" annotation attribute and executing Go To References shows all the references to the PetController type 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) 😀

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Verhalten von Go To References in VS Code Java anhand des Annotation-Beispiels, ausgehend von der Verarbeitung der Referenzsuche für Annotation-Attribute. Überprüfe, dass die Auswahl von "cloud" keine Typreferenzen auf PetController enthält, während Auswahlen auf @Controller, @Profile und PetController ihre erwarteten Ergebnisse beibehalten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, typescript, vscode
Bereich
developer-experience, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.