Does anyone know how to get IntelliJ to recognize ...
# announcements
z
Does anyone know how to get IntelliJ to recognize a DSL and change the syntax highlighting for it. Only example of this I can find is ktor routing. Ktor routing builder functions do not show as the regular funciton color and I’m wondering how they accomplish this.
I mean when creating a new DSL not trying to get it to recognize any DSL and change the highlighting.
s
Use the
DslMarker
annotation
z
I’ve been using that, it doesn’t seem to effect syntax highlighting. Just avoids issues with nested receivers.
Maybe I’m using it wrong
Yeah I was annotating the receiver type instead of the function itself
How does it decide which “Dsl style” to use? There are 4 in IntelliJ settings.
k
It uses a hash to determine which style to use. If you want to make sure 2 markers have a different color, you gotta try some names until you get the one you like.