Skip to content

Fix deprecated/internal API usages reported by plugin verifier (0.9) - #46

Open
suzumaze wants to merge 2 commits into
bearsunday:masterfrom
suzumaze:fix/verifier-deprecated-internal-api
Open

Fix deprecated/internal API usages reported by plugin verifier (0.9)#46
suzumaze wants to merge 2 commits into
bearsunday:masterfrom
suzumaze:fix/verifier-deprecated-internal-api

Conversation

@suzumaze

@suzumaze suzumaze commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

The JetBrains Marketplace verification of 0.9 against IntelliJ IDEA 2026.2.1 RC (262.9437.65) reported:

Compatible. 1 usage of deprecated API. 2 usages of internal API

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):

API Status Fix
FilenameIndex.getFilesByName(Project, String, GlobalSearchScope) Deprecated Switch to FilenameIndex.getVirtualFilesByName() and resolve PsiFile via PsiManager, keeping the same path-suffix filtering
PhpType.from(String...) ×2 @ApiStatus.Internal Build the type with the public new PhpType().add() chain — already the idiom used elsewhere in this class

Verification

  • ./gradlew verifyPlugin against 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 test passes

概要(日本語)

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)→ 同クラス内で既に使用している公開 API new PhpType().add() に置き換え

ローカルで ./gradlew verifyPlugin を再実行し、全5ターゲットで警告なしの「Compatible」になることを確認済みです。テストも全て通過しています。

Summary by CodeRabbit

  • バグ修正

    • IntelliJ IDEA 2026.2.1で報告された非推奨・内部APIの使用を、公開APIを利用する実装へ更新しました。
    • リソースの型情報取得とファイル検索の互換性・安定性を改善しました。
  • ドキュメント

    • 上記の変更内容を未リリースの変更履歴に追加しました。

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.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@suzumaze, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 295a56b5-c76a-4669-8df9-223f0a4e8e43

📥 Commits

Reviewing files that changed from the base of the PR and between 442660c and 08c8669.

📒 Files selected for processing (3)
  • src/main/java/idea/bear/sunday/body/BodyTypes.java
  • src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java
  • src/test/java/idea/bear/sunday/resource/ResourceMethodTypeProviderFixtureTest.java

Walkthrough

ResourceMethodTypeProviderで内部・非推奨APIの使用を置換しました。PhpTypeの生成方法を更新し、ファイル検索を仮想ファイル経由に変更しました。CHANGELOG.mdに変更内容を追加しました。

Changes

API移行

Layer / File(s) Summary
型解決APIの更新
src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java, CHANGELOG.md
PhpType.from()new PhpType().add()へ変更しました。変更内容を変更履歴に追加しました。
ファイル検索APIの更新
src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java
getFilesByName()から仮想ファイル列挙方式へ変更しました。パス接尾辞を検証した後にPSIファイルを取得します。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: koriym

Poem

うさぎがAPIをぴょんと置換
公開メソッドで型を生成
仮想ファイルを順に確認
PSIを見つけて処理を継続
変更履歴にも足あとを残す 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは、非推奨および内部APIの置換という変更内容を正確かつ簡潔に示しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1765a and 442660c.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java

Comment thread src/main/java/idea/bear/sunday/resource/ResourceMethodTypeProvider.java Outdated
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant