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.
zjuhasz
02/07/2020, 5:11 AM
I mean when creating a new DSL not trying to get it to recognize any DSL and change the highlighting.
s
serebit
02/07/2020, 5:26 AM
Use the
DslMarker
annotation
z
zjuhasz
02/07/2020, 5:28 AM
I’ve been using that, it doesn’t seem to effect syntax highlighting. Just avoids issues with nested receivers.
zjuhasz
02/07/2020, 5:32 AM
Maybe I’m using it wrong
zjuhasz
02/07/2020, 5:40 AM
Yeah I was annotating the receiver type instead of the function itself
zjuhasz
02/07/2020, 5:41 AM
How does it decide which “Dsl style” to use? There are 4 in IntelliJ settings.
k
Kroppeb
02/10/2020, 11:21 PM
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.