using Scala in IntelliJ, you can already do
var c = s"some ${compound * expression}"
and have proper syntax highlighting for the ${compound * expression}
. Scala allows you to define custom string interpolaters, to do other things
var c = javascript"var x = [1, 2, 3]"
Does anyone know how to fiddle with the custom-language-injection functionality to nicely highlight these custom string interpolators? I've messed around with the stuff under the File->Settings->Language Injections but it seems really confusing, and I can't find any existing injections that do the magic string interpolation syntax. Presumably that one is hard coded (since it also has the nice code navigation features) but i'm hopeful there'll be some way of getting it to recognize the nice something"..."
syntax and highlighting it nicely for me.
You could do it by hand for each string using the "light bulb", but if you want to do it automatically for each string interpolator, I think you will have to write your own plugin (which may take some time if it is your first plugin).
You may have better answers/help in JetBrains forums directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With