did anything change about how diagnostic factories...
# compiler
z
did anything change about how diagnostic factories repackage
PsiElement
in 2.3.0? I'm trying out a preview of 2.3.0 and finding enabling IDE support now fails in the KTIJ plugin, but not sure if this is an issue on my end or IJ 2025.3 EAP
Copy code
java.lang.IllegalArgumentException: class org.jetbrains.kotlin.psi.KtAnnotationEntry is not a subtype of class org.jetbrains.kotlin.com.intellij.psi.PsiElement for factory SUGGEST_CLASS_INJECTION
	at org.jetbrains.kotlin.diagnostics.KtDiagnosticKt.checkPsiTypeConsistency(KtDiagnostic.kt:108)
	at org.jetbrains.kotlin.diagnostics.KtDiagnosticKt.access$checkPsiTypeConsistency(KtDiagnostic.kt:1)
	at org.jetbrains.kotlin.diagnostics.KtPsiSimpleDiagnostic.<init>(KtDiagnostic.kt:121)
	at org.jetbrains.kotlin.diagnostics.KtDiagnosticFactory0.on(KtDiagnosticFactory.kt:80)
	at org.jetbrains.kotlin.diagnostics.KtDiagnosticReportHelpersKt.reportOn(KtDiagnosticReportHelpers.kt:53)
	at org.jetbrains.kotlin.diagnostics.KtDiagnosticReportHelpersKt.reportOn$default(KtDiagnosticReportHelpers.kt:48)
	at dev.zacsweers.metro.compiler.fir.checkers.InjectConstructorChecker.check(InjectConstructorChecker.kt:99)
Reason I ask is because my plugin does do the workaround to check for both PsiElement locations: https://github.com/ZacSweers/metro/blob/d7367550c004941978326d3f15ec5532dbb3fb44/c[…]ler/src/main/kotlin/dev/zacsweers/metro/compiler/diagnostics.kt
Seems so, if I switch and just use the unshaded one it starts working
h
Yeah, why do you use PsiElement and not the KtElement?
👍 1
I am able to use my plugin inside the IDE without a problem, because KtElement is not affected by shading.
z
tribal knowledge copied from other projects blob upside down
I'll give it a shot
lgtm, thanks!