how does intellij idea know that the string in `"....
# announcements
n
how does intellij idea know that the string in
".*".toRegex()
is regex and marks the string as such so that highlighting works? is this something i can define on a function wit the right annotations? ps: lees like
@Language("LANGUAGE_ID")
works on preoperties.. sadly not on extension properties or extension functions it seems either way jsonpath is not in the list of supported things but this should still be very useful later
t
in theory this should work:
Copy code
fun @receiver:Language("RegExp") String.foo() = bar(this)
If you get the kotlin bytecode and decompile it to java, the annotation is present where you expect it, but intelliJ doesn't seem to pick it up. Might be worth a bug report to Jetbrains
a
You can add a custom rule for this, see https://youtrack.jetbrains.com/issue/KT-39231 for example.
@Language
for receivers really doesn't work, see https://youtrack.jetbrains.com/issue/KT-24518.
👍 3