Better syntax highlighting in Intellij IDEA

Anders Sveen
Jul 24, 2023

--

Quick tip if you’re using Intellij IDEA and not every framework is supported: Add the annotations dependency.

This enables IDEA to get information about certain things in your code and apply the correct validation, information and/or formatting.

We only use it for one thing so far: Marking strings as SQL. That enables IDEA to recognize it and apply the correct highlighting.

The example shows a wrapper method we have for JDBI, and because of the @Language annotation IDEA knows that it should apply SQL syntax highlighting.

See my original blog or the code examples as Medium doesn not import them well.

Originally published at https://blog.f12.no on July 24, 2023.

--

--

Anders Sveen
Anders Sveen

Written by Anders Sveen

Passionate agile developer and mentor for hire @ Mikill Digital

No responses yet