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
Hi Raul Valdoleiros (@raulvaldoleirospowerdot), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Suggestion
Currently the Java textmate grammar in VS Code (used by the Red Hat Java extension) does not recognize JPQL inside Java text blocks or concatenated strings as a distinct language. You have two options:
Fallback to classic concatenation
@Query(
"select a from User" +
" where a.id = :id"
)
Use text blocks without highlighting
@Query(""" select a from User where a.id = :id""")
until JPQL-injection support is added.
No built-in feature or workaround currently exists to inject JPQL syntax highlighting into text blocks. You can track similar requests and add your feedback to help prioritize this feature in the language server.
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
Activity
nickzhums commentedon Jun 5, 2024
Martin Lippert (@martinlippert) Alex Boyko (@BoykoAlex) for awareness
martinlippert commentedon Jun 5, 2024
I would like to suggest to move this issue over to https://github.com/spring-projects/sts4/issues/ where the actual feature is being implemented... :-)
raulvaldoleiros commentedon Jun 5, 2024
Done: spring-projects/spring-tools#1262
martinlippert commentedon Jun 5, 2024
raulvaldoleiros Thanks for moving it, much appreciated !!!
BoykoAlex commentedon Jun 5, 2024
raulvaldoleiros text blocks are supported in the latest version of the spring boot tools extension I believe:

As for string concatenation it'd take some effort to support it.
raulvaldoleiros commentedon Jun 7, 2024
Currently I have the version 1.54.0 installed


I don't have a newest version to install
Maybe I just need to wait for the next stable release.
martinlippert commentedon Jun 7, 2024
raulvaldoleiros There is a button on the extension page to switch to a pre-release version.
raulvaldoleiros commentedon Jun 7, 2024
Martin Lippert (@martinlippert) The pre-release works as expected.
Thanks for the hint :)
github-actions commentedon Nov 4, 2025
Hi Raul Valdoleiros (@raulvaldoleirospowerdot), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Suggestion
Currently the Java textmate grammar in VS Code (used by the Red Hat Java extension) does not recognize JPQL inside Java text blocks or concatenated strings as a distinct language. You have two options:
No built-in feature or workaround currently exists to inject JPQL syntax highlighting into text blocks. You can track similar requests and add your feedback to help prioritize this feature in the language server.
Labels
Duplicate
No duplicates found.
Other references with low confidence
fix #521: add null check before accessing javaExt.exports #525 – Syntax highlighting for SQL in Strings?
Requests SQL highlighting inside Java string literals. No solution yet.
Syntax Highlighting for SQL in Strings? redhat-developer/vscode-java#525
View and copy toString() of objects in the VARIABLES and WATCH windows #1264 – Text block breaks syntax highlighting…
Reports text block syntax highlighting breaks when certain characters appear.
Text block breaks syntax highlighting if an odd number (>=3) of double quotes appear inside the text block redhat-developer/vscode-java#1264 (comment)
Syntax highlight after text block with double slash inside quote #994 – Syntax highlight after text block…
Similar visual glitch in the VS Code Java Pack.
Syntax highlight after text block with double slash inside quote #994
new UX to configure java runtime #791 – Java Syntax high light incorrection
General string-coloring bug, downstream effect of incomplete grammar.
Java Syntax high light incorrection redhat-developer/vscode-java#791
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
martinlippert commentedon Nov 4, 2025
This is already implemented and released as part of the https://github.com/spring-projects/spring-tools/, at least for Spring related projects, so feel free to close this issue here.