https://kotlinlang.org logo
#intellij
Title
# intellij
m

mbonnin

10/03/2023, 4:21 PM
Can I use Language injection in
commonMain
code? I get a symbol not found on
org.intellij.lang.annotations.Language
c

Casey Brooks

10/03/2023, 4:24 PM
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

mbonnin

10/03/2023, 4:24 PM
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

Javier

10/03/2023, 4:34 PM
it will be our secret
👀 1
😄 1
m

mbonnin

10/03/2023, 4:35 PM
TIL!
j

Javier

10/03/2023, 4:37 PM
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

mbonnin

10/03/2023, 4:38 PM
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

Javier

10/03/2023, 4:41 PM
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

mbonnin

10/03/2023, 4:41 PM
It's more for reading them, I don't think KSP exposes the full Kotlin PSI with comments
👍 1