You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for potential spring bean references #290
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.
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.
Activity
Eskibear commentedon Mar 14, 2023
We should be able to add context menu items with in the future.
See microsoft/vscode#175945 (comment)
Eskibear commentedon Mar 14, 2023
Meanwhile we can also enrich the hover message, adding bean reference. This requires spring tools extension to expose more APIs.
gayanper commentedon Mar 14, 2023
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.
martinlippert commentedon Mar 15, 2023
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.