Can I use <Language injection> in `commonMain` cod...
# intellij
m
Can I use Language injection in
commonMain
code? I get a symbol not found on
org.intellij.lang.annotations.Language
c
I think that, generally, you’re not going to be able to use the
kotlin("multiplatform")
plugin to develop Intellij plugins, it’s too tightly coupled with the Java toolchain. It’s been a whiile since I’ve tried so it might be a bit improved by now, but last time I tried the only way I could get things to work like I expected was to use
kotlin("jvm")
m
It's mainly a matter of using the existing IDE support, not developing new one
But for the existing IDE support to work, I need
@Lnaguage
in my
commonCode
Looks like I can redefine the annotation in my code and it can be picked up by IDEA but it's not ideal
j
it will be our secret
👀 1
😄 1
m
TIL!
j
It is on the page you shared, at the bottom. I think it should be the first result as using a comment is easier than adding any kind of library
m
I'm much older than 30, my brain cannot process all that information 😄
Also, I was kindof hoping to build on top of the annotation, i.e. use it as a marker for KSP processing so would still be nice to have the annotation
j
Hahaha, same for me, I just looked into that section because I knew this feature existed and it was weird for me it wasn't there. About Ksp, does not it support adding comments? I vaguely remember Kotlinpoet supporting them, but I could be inventing all of this.
m
It's more for reading them, I don't think KSP exposes the full Kotlin PSI with comments
👍 1