Fix deprecated/internal API usages reported by plugin verifier (0.9) - #46
Fix deprecated/internal API usages reported by plugin verifier (0.9)#46suzumaze wants to merge 2 commits into
Conversation
The Marketplace verification of 0.9 against IntelliJ IDEA 2026.2.1 RC (262.9437.65) reported 1 deprecated and 2 internal API usages, all in ResourceMethodTypeProvider: - FilenameIndex.getFilesByName(Project, String, GlobalSearchScope) is deprecated: switch to FilenameIndex.getVirtualFilesByName() and resolve PsiFile via PsiManager, keeping the same path-suffix filtering. - PhpType.from(String...) is marked @ApiStatus.Internal: build the type with the public new PhpType().add() chain instead (already the idiom used elsewhere in this class). Verified locally with ./gradlew verifyPlugin: all 5 IDE targets (PS-251 .. PS-262.9437.67) now report "Compatible" with no deprecated or internal API warnings.
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Walkthrough
ChangesAPI移行
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java`:
- Around line 115-117: Update the SIGNATURE_BODY handling in resolveBodyType so
each component of declaration.bodyType()’s union is added individually to
PhpType instead of adding the rendered union string as one type; then add
PhpType._NULL as before. Reuse the body-type union’s component
iteration/accessor so BodyTypeInferer.getTypes() receives separate types.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c8181228-3a73-44b4-88cc-b9d2877baea6
📒 Files selected for processing (2)
CHANGELOG.mdsrc/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java
PhpType.add(String) stores its argument as one opaque type, so adding a
rendered union ("array{…}|array{…}") produced a single unparseable type
entry. Add each union component separately (CodeRabbit review on bearsunday#46);
non-union declarations keep the previous single-add path.
Summary
The JetBrains Marketplace verification of 0.9 against IntelliJ IDEA 2026.2.1 RC (262.9437.65) reported:
All three usages are in
ResourceMethodTypeProvider(they are separate from the ones already fixed in #45, which is not included in the released 0.9 artifact):FilenameIndex.getFilesByName(Project, String, GlobalSearchScope)FilenameIndex.getVirtualFilesByName()and resolvePsiFileviaPsiManager, keeping the same path-suffix filteringPhpType.from(String...)×2@ApiStatus.Internalnew PhpType().add()chain — already the idiom used elsewhere in this classVerification
./gradlew verifyPluginagainst all 5 recommended IDE targets (PS-251.29188.4 … PS-262.9437.67): all now report "Compatible" with no deprecated or internal API warnings./gradlew testpasses概要(日本語)
Marketplace の 0.9 検証(IntelliJ IDEA 2026.2.1 RC)で報告された deprecated API 1件・internal API 2件を修正しました。3件とも
ResourceMethodTypeProvider内です(#45 で修正済みのものとは別で、リリース済み 0.9 には #45 が含まれていません)。FilenameIndex.getFilesByName()(deprecated)→ 後継のgetVirtualFilesByName()+PsiManager#findFileに置き換え(パス末尾のフィルタリングは従来どおり)PhpType.from()(internal)→ 同クラス内で既に使用している公開 APInew PhpType().add()に置き換えローカルで
./gradlew verifyPluginを再実行し、全5ターゲットで警告なしの「Compatible」になることを確認済みです。テストも全て通過しています。Summary by CodeRabbit
バグ修正
ドキュメント