Drop KaContextReceiver usage for KaContextParameterSymbol#179
Conversation
IDEA 2026.3 removes KaContextReceiver and KaContextReceiversOwner (KT-87288, KT-87310). Migrate the K2 receiver-stability analysis to KaContextParameterSymbol, which is stable as of Kotlin 2.4. The context type is now read via KaContextParameterSymbol.returnType; stability grading is unchanged, and both required opt-ins (@KaExperimentalApi, @KaImplementationDetail) are already enabled. Fixes #177
📝 WalkthroughWalkthroughUpdates ChangesContext Parameter API Migration
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
compose-stability-analyzer-idea/src/main/kotlin/com/skydoves/compose/stability/idea/k2/StabilityAnalyzerK2.kt (1)
191-207: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winGuard
contextParametersbehind a linkage-safe fallbackKotlin 2.4 introduced
KaContextParameterSymbol, but this module still advertisessinceBuild = "242".functionSymbol.contextParameterscan throwNoClassDefFoundError/AbstractMethodErroron older bundled Kotlin APIs, and the currentcatch (e: NoSuchMethodError)/catch (e: Exception)won’t catch those. CatchLinkageError(or otherwise guard this access) so the PSI fallback still kicks in on 242-era IDEs.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@compose-stability-analyzer-idea/src/main/kotlin/com/skydoves/compose/stability/idea/k2/StabilityAnalyzerK2.kt` around lines 191 - 207, The `StabilityAnalyzerK2` path that iterates `functionSymbol.contextParameters` is not safe on older bundled Kotlin APIs, since it can throw linkage failures before the PSI fallback runs. Update the context-parameter branch to guard that access in a linkage-safe way by catching `LinkageError` (not just `NoSuchMethodError` or `Exception`) or otherwise checking API availability before reading `contextParameters`. Keep the existing fallback behavior intact so the analyzer can still recover on 242-era IDEs.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@compose-stability-analyzer-idea/src/main/kotlin/com/skydoves/compose/stability/idea/k2/StabilityAnalyzerK2.kt`:
- Around line 191-207: The `StabilityAnalyzerK2` path that iterates
`functionSymbol.contextParameters` is not safe on older bundled Kotlin APIs,
since it can throw linkage failures before the PSI fallback runs. Update the
context-parameter branch to guard that access in a linkage-safe way by catching
`LinkageError` (not just `NoSuchMethodError` or `Exception`) or otherwise
checking API availability before reading `contextParameters`. Keep the existing
fallback behavior intact so the analyzer can still recover on 242-era IDEs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1780615f-6621-4934-9484-342648e50f52
📒 Files selected for processing (1)
compose-stability-analyzer-idea/src/main/kotlin/com/skydoves/compose/stability/idea/k2/StabilityAnalyzerK2.kt
Fixes #177, reported by a JetBrains engineer: IDEA 2026.3 deprecates and drops the context-receiver API surface (
KaContextReceiver,KaContextReceiversOwner) see KT-87288 and KT-87310. This migrates the plugin to context parameters (KaContextParameterSymbol), which are stable as of Kotlin 2.4.