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

[Spring Data Queries] Show document highlights when the cursor is at query parameter AST node #1332

Closed
BoykoAlex opened this issue Aug 23, 2024 · 3 comments
Labels

Comments

@BoykoAlex
Copy link
Contributor

All Spring Data Query whether it is JPQL/HQL or a native SQL query support parameters coming from java code. Typically @Query annotates a method, then :1 or ?2 found in the query would stand for the first and second parameter of the Java method respectively. It's be useful to show the Java parameter and its usage in Java code once the cursor is at the parameter node (or perhaps when hovering the mouse over that node).
LSP has Document Highlights feature that we could try using for this scenario

@BoykoAlex
Copy link
Contributor Author

Fixed with 0063608. Only highlights method parameter. These methods are inside an interface typically so no need to go through the method body. Works in VSCode but in Eclipse Java editor LSP support is required

@martinlippert
Copy link
Member

@BoykoAlex Let's track the missing support in the Eclipse Java source editor as a separate issue.

@martinlippert
Copy link
Member

Feels like we should also cover additional cases as well. If you have a query string like:

"SELECT DISTINCT owner FROM Owner owner left join  owner.pets WHERE owner.lastName LIKE :lastName% "

we should highlight all occurrences of owner when you have the cursor inside of of the occurrences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants