using Scala in IntelliJ you can already do
var c = s"some ${compound * expression}"
and have the correct syntax highlighting for ${compound * expression} . Scala allows you to define custom string interpolators, do other things
var c = javascript"var x = [1, 2, 3]"
Does anyone know how to tinker with custom I / O functions to highlight these custom string interpolators well? I came across things in the “File-> Settings-> Language Injections” section, but this seems really confusing, and I cannot find any existing injections that perform the magic string interpolation syntax. It is supposed to be hardcoded (since it also has good code navigation features), but I hope there will be some way to make it recognize the good something"..." syntax and highlight it well for me.
string scala intellij-idea syntax-highlighting
Li Haoyi
source share