Andre T
11/30/2023, 8:42 AMKSDeclaration.docString
. However, I feel it might be beneficial to avoid dragging KSP into this as well, as I probably need to then create a Gradle wrapper plugin to combine the KSP module and the regular compiler plugin module. After all, one of the benefits of going the K2 route is not having to deal with Gradle plugins.
So I tried this:
fun FirDeclaration.findKDocString(): String? = source?.let {
val kidsRef = Ref<Array<LighterASTNode?>>()
it.treeStructure.getChildren(it.lighterASTNode, kidsRef)
kidsRef.get().singleOrNull { it?.tokenType == KtTokens.DOC_COMMENT }?.toString()
}
Andre T
11/30/2023, 8:53 AMCaused by: java.lang.NoClassDefFoundError: com/intellij/openapi/util/Ref
I then added various com.jetbrains.intellij.platform
dependencies (core, util, etc.). This gets me to:
Caused by: java.lang.NoSuchMethodError: 'com.intellij.util.diff.FlyweightCapableTreeStructure org.jetbrains.kotlin.KtSourceElement.getTreeStructure()'
Not sure how to resolve this. Seems to be a missing dependency or a version mismatch. All examples I found are basically forks of the whole compiler (with dependency graphs that are hard to figure out) but I'm trying to create a standalone plugin.
I'm using 232.10227.8
as IntelliJ platform version and I'm using K2 (language version set accordingly).