Skip to content

Refactor CollectAnnotatedSymbolsPsiVisitor#2932

Merged
jaschdoc merged 1 commit intomainfrom
rewrite-psi-visitor
May 8, 2026
Merged

Refactor CollectAnnotatedSymbolsPsiVisitor#2932
jaschdoc merged 1 commit intomainfrom
rewrite-psi-visitor

Conversation

@jaschdoc
Copy link
Copy Markdown
Collaborator

@jaschdoc jaschdoc commented May 6, 2026

The visitor now considers annotated elements instead of visiting annotations and then relying / knowing the internal structure of the AST to find the annotated elements. This implementation should be more resilient since it only assumes the API to be correct instead of the internal tree structure of the program.

@jaschdoc jaschdoc force-pushed the rewrite-psi-visitor branch 2 times, most recently from c13776b to 54b2e81 Compare May 8, 2026 09:50
The visitor now considers Kotlin or Java elements that could be annotated
and adds them to the list of results if there any annotations.
This is more resilient that checking for every possible case of how
an annotation might occur and relying on its internal structure which might
change in the future or have edge cases.
@jaschdoc jaschdoc force-pushed the rewrite-psi-visitor branch from 54b2e81 to b843435 Compare May 8, 2026 09:54
@jaschdoc jaschdoc marked this pull request as ready for review May 8, 2026 10:52
@jaschdoc jaschdoc requested a review from troelsbjerre as a code owner May 8, 2026 10:52
@jaschdoc jaschdoc merged commit 7940198 into main May 8, 2026
19 checks passed
@jaschdoc jaschdoc deleted the rewrite-psi-visitor branch May 8, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants