Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

vscode @DependsOn navigation not linked #1254

Closed
lamplification opened this issue May 22, 2024 · 8 comments
Closed

vscode @DependsOn navigation not linked #1254

lamplification opened this issue May 22, 2024 · 8 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: code completion theme: spring index & symbols type: enhancement

Comments

@lamplification
Copy link

Spring uses the class name and converts the first letter to lowercase by default. In vscode, @dependsOn("BEAN_NAME") won't able to find the bean and not able to navigate to DependsOn bean class.

To Reproduce
Create 2 Compoments.

@Component 
public class TestBean1 {}
@Component
@DependsOn("testBean1")
public class TestBean2 {}

Notice DependsOn(testBean1) is not clickable.
If it use the class name TestBean1 then that will work, but it won't work during the run time.

@Component
@DependsOn("TestBean1")
public class TestBean2 {}

demo.tar.gz

@lamplification
Copy link
Author

@martinlippert , thank you for looking into this.

@martinlippert
Copy link
Member

Actually, the case with an upper case - @DependsOn("TestBean1") in your case - only works by accident due to the Java language tooling itself interpreting this as random string as a class name and searches for that class.

Will add proper support for navigating to the actual referenced bean definition. Just keep in mind that there might be multiple definitions for that bean being found in your project.

@martinlippert
Copy link
Member

Okay, so navigation support (7ee4e07) as well as auto-completion for bean names (d8e067a) is in now. Closing this as fixed for upcoming 4.23.0 release.

@martinlippert
Copy link
Member

@lamplification Thanks again for reporting this and for proving a demo project. Much appreciated.

@lamplification
Copy link
Author

@martinlippert , thank you for the quick turn around!

@martinlippert
Copy link
Member

In VSCode, you could switch the extension install over to the pre-release to try this out already, btw.

@lamplification
Copy link
Author

@martinlippert , I switched to pre-release and that patch works like a charm! Thank you!

@martinlippert
Copy link
Member

Awesome, great to hear it works for you. Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: code completion theme: spring index & symbols type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants