Skip to content

Commit ce6f406

Browse files
serpentbladeclaude
andcommitted
fix(intellij-plugin): drop removed JSBlockStatement.getStatements() call
RoziePropsModel.directEntries() read `element.statements` on a JSBlockStatement — the Kotlin accessor for JSBlockStatement.getStatements(), which is @deprecated in IntelliJ 2024.2 and REMOVED in 2025.3. The plugin verifier (SC-5 binary-compatibility gate) failed against IU-253 with an unresolved-method / NoSuchMethodError problem. Replace it with PsiTreeUtil.getChildrenOfTypeAsList(element, JSLabeledStatement) — a stable API present in both 2024.2 and 2025.3 that yields the same direct labeled-statement children the call site filtered for. compileKotlin green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4ebb9d5 commit ce6f406

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tools/intellij-plugin/src/main/kotlin/js/rozie/intellij/props/RoziePropsModel.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ object RoziePropsModel {
9797
Entry(name, p.nameIdentifier ?: p, p.value)
9898
}
9999
is JSBlockStatement ->
100-
element.statements.filterIsInstance<JSLabeledStatement>().mapNotNull { labeled ->
100+
// Direct labeled-statement children. NOT `element.statements`: that
101+
// is `JSBlockStatement.getStatements()`, deprecated in 2024.2 and
102+
// removed in 2025.3 — the verifier flags it as a binary-compat
103+
// (NoSuchMethodError) problem. `PsiTreeUtil.getChildrenOfTypeAsList`
104+
// is stable across both platform versions and gives the same set.
105+
PsiTreeUtil.getChildrenOfTypeAsList(element, JSLabeledStatement::class.java).mapNotNull { labeled ->
101106
val name = labeled.label ?: return@mapNotNull null
102107
Entry(name, labeled.labelIdentifier ?: labeled, labeled.statement)
103108
}

0 commit comments

Comments
 (0)