Repository navigation
ADFA-6560: Restore plugin-api constructors that older plugins call - #2173
Merged
Merged
Conversation
…change Editing the file pulls it under the Spotless ratchet, which reindents it to tabs and adds trailing commas. Kept separate from the ADFA-6560 fix.
#1268 added directPath to PluginTooltipButton, which replaced the (String, String, int) constructor. Plugins built before it, such as older Keystore Generator installs, call that constructor from getTooltipEntries, so their documentation install fails with NoSuchMethodError on every launch (fatal on older releases). Add the old constructor back as a hidden secondary constructor. It restores both (String, String, int) and its default-order synthetic, while staying invisible to Kotlin source, so current callers resolve to the primary constructor as before.
There was a problem hiding this comment.
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.
Contributor
hal-eisen-adfa
approved these changes
Oct 20, 2026
…no functional change Editing both files pulls them under the Spotless ratchet. Kept separate from the ADFA-6560 fix.
NavigationItem, TabItem, FileTabMenuItem and MenuItem gained tooltipTag (MenuItem also icon) after April, which replaced the constructors that plugins built before then call. An old Keystore Generator build still failed on NavigationItem's constructor in getSideMenuItems after the PluginTooltipButton fix. Add the old constructors back as hidden secondary constructors. NavigationItem, TabItem and FileTabMenuItem take the old parameters with the old defaults, which restores both the full constructor and its default-argument synthetic. MenuItem's full constructor survived through @jvmoverloads, so only its default-argument constructor is restored, with the exact JVM signature and the April defaults applied from the mask.
Pinning languageVersion to 2.1 (ADFA-4058, later 2.0) dropped Kotlin's newer jvm-default behaviour, so plugin-api compiled every interface body as an abstract method plus a DefaultImpls static. Plugins built against the earlier plugin-api call the interface default with invoke-super. The April Keystore Generator, for one, hit AbstractMethodError on UIExtension.getToolbarActions() in EditorActivity.onCreate. The plugin crash guard caught it, but the editor stayed blank until the plugin was disabled. jvmDefault = ENABLE keeps the language pin and puts the bodies back on the interfaces. It keeps DefaultImpls for plugins built since May, and restores the IdeArchiveService.extract$default and IdeCommandService.executeCommand$default helpers that pre-May callers link against. A plugin built against this plugin-api has no DefaultImpls stubs, so on an IDE built between ADFA-4058 and 26.42 it needs to override every interface method it uses. PLUGIN_API_CHANGELOG.md says so. InterfaceDefaultMethodsTest fails without the change: getToolbarActions is not a default method, and neither is any body behind a DefaultImpls static. fragment-ktx joins the test runtime classpath because EditorTabExtension takes a Fragment and reflection has to load it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADFA-6560
Makes it safe to add methods with a default body to plugin interfaces, and lets plugins built before May load again.
jvmDefault = ENABLE). Since the ADFA-4058languageVersionpin they were abstract methods plusDefaultImpls. So each method with a body added to an interface a plugin implements failed withAbstractMethodErrorin every plugin built before it, unless the host wrapped the call (asPluginUiActionManagerdoes forgetHiddenToolbarActionIds). Those plugins now inherit the body.DefaultImplsstays, so plugins built since May are unaffected.PluginTooltipButton(String, String, int)(Add plugin sidebar/toolbar tooltips and directPath URI option #1268), the pre-tooltipTagconstructors ofNavigationItem,TabItem,FileTabMenuItemandMenuItem(hidden from Kotlin source), and theIdeArchiveService.extractandIdeCommandService.executeCommanddefault-argument helpers. The April Keystore Generator build behind GlitchTip 8548737 works again. The builds on addons.appdevforall.org were never affected.A plugin built against this plugin-api needs IDE 26.43 or later unless it overrides every interface method it implements (noted in PLUGIN_API_CHANGELOG.md). The two
style:commits are Spotless reformats only.