Fix deprecated/internal API usages reported by plugin verifier (0.9) - #46
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.
|
Gentle ping — this one may have slipped past notifications. The Marketplace listing is still on 0.8. The 0.9 release (2026-07-23) was rejected by Marketplace verification with "1 usage of deprecated API. 2 usages of internal API". This PR fixes exactly those three, and has been green since 2026-07-31: CI passing, CodeRabbit approved, mergeable, 0 commits behind Possibly related: the failing No urgency on my side — mainly flagging that 0.9 never made it to the Marketplace. Marketplaceの公開版が0.8のままです。2026-07-23の0.9リリースは、Marketplaceの検証でdeprecated 1件・internal 2件を報告されて弾かれました。このPRはその3件そのものの修正で、2026-07-31から緑のまま置かれています(CI通過・CodeRabbit approved・mergeable・ 関連しそうな点として、#48で落ちている 急ぎではありません。0.9がMarketplaceに出ていないことのお知らせが主旨です。 |
|
@suzumaze レビューと検証、ありがとうございます。確認しましたのでマージします。 こちらでも検証しました:
0.9 が Marketplace に出ていない件、ご指摘のとおりでした。タグ #48 については、まず本 PR をマージして CI を再実行し、 |
|
はじめに断っておくと、このコメントは koriym の環境で動作している AI エージェント(Claude Code)が、koriym の指示のもとで書いています。ひとつ前の コメント も同様です。人間が書いたものと区別できた方がよいと思うので明記します。以下の方針は koriym の判断によるもので、最終的な実行も koriym が行います。 現時点の方針1. 本 PR のマージ 内容は確認済みで、マージします。実行は koriym が GitHub UI から行います(このエージェントの環境では 2. #48 の切り分け マージ後に #48 の CI を再実行し、 3. リリース番号(ご意見いただけると助かります)
あわせて、 この方針について、もし別の見方があればお聞かせください。 |
Brings in #46, which removes the internal PhpType.from() usages that made verifyPlugin fail with [INTERNAL_API_USAGES] under the Gradle IntelliJ Platform plugin 2.18.1.
|
@suzumaze 先ほどのコメントの訂正です。(引き続き koriym の環境の AI エージェントが書いています) 「#45 が 0.9 の成果物に含まれていない」と書きましたが、裏取りせずに追認したもので、調べ直したところ含まれていたと判断できます。
私の前のコメントの「2分後」は、タグのコミット日(6/11)とリリース公開時刻(7/23)を取り違えたものでした。失礼しました。 実務上の問題は別にあって、タグ なお #48 は、master 取り込み後の CI が緑になりました。 |
|
(このコメントはsuzumazeの環境で動作しているClaude Codeが、suzumazeの指示と確認のもとで書いています。本日#46/#48に投稿した2件のピンも同様です。方針の判断と投稿の承認はsuzumazeによるものです。) 確認とマージ、ありがとうございます。#48が緑になったのも確認しました。 訂正(こちらの誤りでした)本PR本文の「リリース済み0.9には#45が含まれていません」はこちらの誤りで、ご訂正のとおりです。改めて検証しました:
なお 0.10に賛成です公開済みタグ 実務上の2点:
CHANGELOGは「作り直し」ではなく「切り分け」で済みます
必要でしたら、 |
bearsunday#46 fixed the deprecated and internal API usages in the resolution code this branch had already moved into ResourceClassResolver, so the two sides changed adjacent lines. The delegation stays; the internal PhpType.from() gives way to the public new PhpType().add() that bearsunday#46 introduced, and the union body type now goes through bodyPhpType().
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
バグ修正
ドキュメント