Skip to content

Add support for potential spring bean references #290

Open

Description

@gayanper

Today we highlight beans with gutter icons with an action of "reveal in dashboard". But the same information we get from SpringBoot LS can be used to provide potential spring bean reference as well.

@Configuration
class Config {
     @Bean
     HttpClient httpClient() {}
}

@Service
class ServiceX {
    public ServiceX(HttpClient client) {}
}

Now here we can provide a potential bean usage references at Config class for gutter icon for bean "httpClient". And also we can provide a potential definition references for constructer parameter ServiceX by looking at the same bean information we get from SB LS.

We can show a different gutter icon or a different action name to make it highlight that these are "potential" references. Another way would be to do the same in Dashboard with a different edge representation while the application is not running. Either solution would provide the functionality.

Why

This feature will enable to trouble shoot bean definition when running tests. To find out where certain beans are coming from. Also it make the navigation easy with a kind of "potential"ness.

Activity

  1. Eskibear commented on Mar 14, 2023

    @Eskibear
    Member

    We should be able to add context menu items with in the future.
    See microsoft/vscode#175945 (comment)

  2. Eskibear commented on Mar 14, 2023

    @Eskibear
    Member

    Meanwhile we can also enrich the hover message, adding bean reference. This requires spring tools extension to expose more APIs.

  3. gayanper commented on Mar 14, 2023

    @gayanper
    Author

    I have reported this spring-projects/spring-tools#994. Once we have the symbols which we can connect each other, we can look into a better API.

  4. martinlippert commented on Mar 15, 2023

    @martinlippert
    Collaborator

    I created spring-projects/spring-tools#1006 for initial work on a new internal Spring component model that would contain this injection point information (as well as other details). Please take a look and add your thoughts around this model + corresponding API.

  5. removed their assignment
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementupstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions