Skip to content

ADFA-7134: Let plugins show the IDE's own documentation - #2292

Merged
Daniel-ADFA merged 3 commits into
stagefrom
bugfix/ADFA-7134-host-doc-tooltips
Nov 25, 2026
Merged

Daniel-ADFA merged 3 commits into
stagefrom
bugfix/ADFA-7134-host-doc-tooltips

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-7134

IdeTooltipService.showTooltip(anchor, category, tag) ignored category, so a plugin could not show the IDE's own documentation. The Layout Editor plugin needs java / android.widget.TextView. The method now reads ide, java, kotlin and xml. Any other category still maps to the plugin's own, because Keystore-Generator passes plugin_keystore_generator, which is not its plugin ID.

The plugin half is appdevforall/addons#175. The changelog entry sits under 26.48, assuming this ships in the next release.

The first commit is a Spotless reformat of the three touched files only. It also drops an orphaned KDoc that ktlint rejects.


Code Reviewer: Code Reviewer couldn't review this pull request
The pull request author does not have access to AI for the associated Atlassian organization.

Drops the orphaned KDoc at the end of IdeTooltipService, which ktlint rejects.
IdeTooltipService.showTooltip(anchor, category, tag) ignored the category and always read the plugin's own entries, so the Layout Editor plugin could not show java/android.widget.TextView. It now reads the IDE's ide, java, kotlin and xml categories; any other category still maps to the plugin's own, which keeps plugins that pass their category under another spelling working.

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Release notes

  • IdeTooltipService.showTooltip(anchorView, category, tag) now reads IDE documentation for the categories ide, java, kotlin, and xml.
  • Any other category reads the calling plugin's own documentation entries.
  • The uncategorized showTooltip(anchorView, tag) overload is unchanged. Its documentation now states that it reads the plugin's own entries.
  • The changelog entry is in 26.48 (unreleased). It sets plugin.min_ide_version to 26.48.
  • The Layout Editor plugin needs the java category for android.widget.TextView. Its plugin-side change is in a separate addons PR.

Risks and best-practice notes

  • Behavior change: plugins that already call showTooltip with ide, java, kotlin, or xml now get IDE documentation. Before this change, they got their own entries. Plugin authors must check these calls.
  • Hardcoded allowlist: the four category names are fixed in PluginTooltipNaming.kt. Adding a category requires an IDE code change.
  • Passing another plugin's ID as a category: the objectives say Keystore-Generator passes plugin_keystore_generator. That value is not its plugin ID. Under the new rule, it falls through to the plugin's own category. Confirm that this is the intended result.
  • Correction to the earlier AI summary: it reported that hasTooltip was removed. The diff does not support this. The original file contained only a KDoc block for hasTooltip with no declaration. The commit removed that orphaned comment. No public method was removed.
  • Not verified: this review did not confirm test or CI results. The new PluginReadableCategoryTest cases were not run.

The categorized tooltip API uses IDE documentation for ide, java, kotlin, and xml, and the calling plugin’s documentation for other categories. The API documentation removes hasTooltip. The changelog records the behavior and a minimum IDE version of 26.48.

Changes: Tooltip category routing

Layer / File(s) Summary
Tooltip API and release contract
plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt, docs/PLUGIN_API_CHANGELOG.md
The API documentation describes categorized and uncategorized tooltip lookups. The hasTooltip declaration is removed. The changelog records the built-in categories and minimum IDE version 26.48.
Category resolution and tooltip display
plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/PluginTooltipNaming.kt, plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt, plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/PluginReadableCategoryTest.kt
The manager preserves the four built-in categories and maps other categories to the plugin category. The category-taking overload uses the resolved category for tooltip display and error logging. Tests cover both mappings.

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

Sequence Diagram(s)

sequenceDiagram
  participant Plugin as Plugin caller
  participant TooltipService as IdeTooltipServiceImpl
  participant CategoryResolver as pluginReadableCategory
  participant TooltipManager
  Plugin->>TooltipService: showTooltip(anchorView, category, tag)
  TooltipService->>CategoryResolver: Resolve category for pluginId
  CategoryResolver-->>TooltipService: Built-in category or plugin category
  TooltipService->>TooltipManager: Show tooltip with resolved category
Loading

Possibly related PRs

  • appdevforall/CodeOnTheGo#2163: Changes the tooltip reader and writer database schema used by the tooltip lookups routed through TooltipManager.

Suggested reviewers: davidschachteradfa

Merge Risk: Minimal · up to 9339a

Plugins can now show the IDE's own documentation for the ide, java, kotlin and xml categories, while other categories still use the plugin's own entries. The change is small, covered by tests, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the ticket and states the main change: plugins can now show the IDE's own documentation through IdeTooltipService.showTooltip. The changeset matches this. The categorized overload now …
Description check Passed The description explains the bug (showTooltip ignored category), the needed behavior (ide, java, kotlin, xml categories read the IDE's documentation), the fallback to the plugin's own category, the li…
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.
Full details: Title check

Explanation

The title names the ticket and states the main change: plugins can now show the IDE's own documentation through IdeTooltipService.showTooltip. The changeset matches this. The categorized overload now reads ide, java, kotlin, and xml documentation, and a new pluginReadableCategory function supports this. The title does not cover the removed hasTooltip method, but it does not need to.

Full details: Description check

Explanation

The description explains the bug (showTooltip ignored category), the needed behavior (ide, java, kotlin, xml categories read the IDE's documentation), the fallback to the plugin's own category, the linked plugin-side PR, the changelog placement, and the Spotless and KDoc cleanup commit. All of this matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the category list
Four paths lead to IDE notes
Other tags find plugin entries
Tests follow each routing rule
The changelog marks the version
The rabbit hops away at dusk

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 5eb8d7b5-af27-422b-9063-02cc7fad0b8c
Commits

Reviewing files that changed from the base of the PR and between ffb5637 and 9339a7e.

Files selected for processing: 1

  • docs/PLUGIN_API_CHANGELOG.md
Files skipped from review as they are similar to previous changes: 1

  • docs/PLUGIN_API_CHANGELOG.md

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@hal-eisen-adfa

Copy link
Copy Markdown
Collaborator

Please fix the merge conflict

@Daniel-ADFA
Daniel-ADFA merged commit a09e5fa into stage Nov 25, 2026
5 checks passed
@Daniel-ADFA
Daniel-ADFA deleted the bugfix/ADFA-7134-host-doc-tooltips branch November 25, 2026 17:07
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.

3 participants