Search code examples
intellij-ideajdbi

Adding IntelliJ Language injections to a library


Can I retrofit a library with IntelliJ's Language injections? I know how to add them to my own code via annotations or comments, but I'd like to have the syntax coloring in JDBI's @SqlUpdate and @SqlQuery as well.


Solution

  • Position your text cursor on the query literal, press Alt+Enter and select Inject language or reference. Then choose your desired SQL dialect and you should be set.

    here's how the language injection intention looks