Skip to content

Navigational aid for Spring Events #1348

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jonsmithers opened this issue Sep 9, 2024 · 5 comments
Closed

Navigational aid for Spring Events #1348

jonsmithers opened this issue Sep 9, 2024 · 5 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: spring index & symbols type: enhancement

Comments

@jonsmithers
Copy link

jonsmithers commented Sep 9, 2024

Expected Behavior

Anytime you trigger or listen for a spring event, IntelliJ presents these gutter icons. When clicked, a popup will list every place that triggers the event you're listening for OR every place that listens for the event that you're triggering, allowing you to easily jump to these locations. I like this feature.

Screenshot 2024-09-09 at 5 04 04 PM Screenshot 2024-09-09 at 5 05 05 PM

Current Behavior

Currently there is nothing to aid navigation between event listeners and triggerers.

Context

This feature is pretty handy in a codebase that relies on Spring Events.

As an alternative, I could consider refactoring the code to not use Spring Events. Spring Events are harder to navigate compared to plain old function invocations, unless the IDE provides this navigational aid.

@jonsmithers jonsmithers changed the title Aid for navigating Spring Events Navigational aid for Spring Events Sep 9, 2024
@martinlippert martinlippert added status: needs-investigation theme: spring index & symbols for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode and removed status: waiting-for-triage labels Sep 10, 2024
@martinlippert
Copy link
Member

Thanks @jonsmithers for raising this enhancement request, sounds indeed like a great feature to add. Let's see how we can get this realized.

Do you use the Spring Tools in Eclipse or VSCode?

@martinlippert martinlippert added this to the 4.27.0.RELEASE milestone Sep 10, 2024
@jonsmithers
Copy link
Author

Using vscode here! And awesome, thank you!

@martinlippert
Copy link
Member

Moving out to 4.29.0 release, more groundwork needed in the indexer code to allow something like this.

@martinlippert
Copy link
Member

The first version of this includes basic information about event listeners and event publishers in the internal index for Spring elements and allows to use the "Go To References" feature inside of VSCode to find all publishers for the specific event type when invoked from a listener and vice versa.

There are no gutter icons or features in the gutter for this specifically, the type hierarchy of events is not yet taken into account, and there is no way to invoke this from the Java editor inside of Eclipse yet. All those things should be captured in separate issues as improvements moving forward.

@martinlippert
Copy link
Member

(please note that even though the 4.28.0 release is not yet out there, this will appear starting from release 4.29.0.

martinlippert added a commit that referenced this issue Feb 4, 2025
GH-1461: hierarchy of events taken into account when looking for references from listeners, too

GH-1462: event listener index nodes now not created twice for type and annotation anymore
martinlippert added a commit that referenced this issue Feb 5, 2025
GH-1461: hierarchy of events taken into account when looking for references from listeners, too

GH-1462: event listener index nodes now not created twice for type and annotation anymore
martinlippert added a commit that referenced this issue Feb 6, 2025
GH-1461: hierarchy of events taken into account when looking for references from listeners, too

GH-1462: event listener index nodes now not created twice for type and annotation anymore
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: spring index & symbols type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants