Chris Lee
08/12/2024, 1:37 AMWe’re actively working on assisting plugin authors to quickly make their plugins compatible with K2 mode.Its challenging for users to beta test K2 mode when required plugins are incompatible and there’s not a clear path to compatibility. This limits the effectiveness of K2 beta if it isn’t (always) practical for users to enable it. Example: https://github.com/kotest/kotest-intellij-plugin/issues/289
Marco Pennekamp [JetBrains]
08/12/2024, 4:51 PMChris Lee
08/12/2024, 4:56 PMMarco Pennekamp [JetBrains]
08/12/2024, 4:58 PMEmil Kantis
08/15/2024, 8:19 PMMarco Pennekamp [JetBrains]
08/19/2024, 11:08 AMThe Analysis API mainly targets the K2 Kotlin compiler, but there is also limited support for the legacy 1.0 compiler. So the same piece of logic, if implemented on top of the Analysis API, can work both in the K1 and K2 Kotlin modes.If you run into any problems, please let us know!
Ng Hui Qin
10/02/2024, 7:04 PMException: org.jetbrains.kotlin.utils.exceptions.KotlinIllegalArgumentExceptionWithAttachments: Unexpected FirElement FirRegularClassImpl
I hit a failure where the code looks like:
object A {
private data class Q { ... }
private fun someMethod(number: Int): Q? { ... } // analyze(KtDeclaration) { getReturnKtType() } will throw exception
}
My naive analysis code, I capture the declarations from PsiFile and try to filter return type with String.
fun KtDeclaration.hasStringType(): Boolean {
analyze(this) {
return getReturnKtType() == builtinTypes.STRING
}
}
Wonder is it necessary I should register kotlin-compiler-fir-for-ide library when setup this standalone session?