Skip to content

Fix inspection shortName mismatch with plugin.xml#3

Merged
AndroidPoet merged 1 commit into
AndroidPoet:masterfrom
timkrest:fix-inspection-shortname-mismatch
May 27, 2026
Merged

Fix inspection shortName mismatch with plugin.xml#3
AndroidPoet merged 1 commit into
AndroidPoet:masterfrom
timkrest:fix-inspection-shortname-mismatch

Conversation

@timkrest
Copy link
Copy Markdown
Contributor

@timkrest timkrest commented May 27, 2026

Opening any Kotlin file throws PluginException on every highlighting pass:

com.intellij.diagnostic.PluginException: Short name not matched for class
io.androidpoet.composeguard.inspection.ComposeGuardInspection:
getShortName() = #ComposeRules; ep.shortName = #ComposeGuard
    at com.intellij.codeInspection.ex.InspectionToolWrapper.getTool(InspectionToolWrapper.java:85)
    at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.getInspectionTools(LocalInspectionsPass.java:523)

plugin.xml registers shortName="ComposeGuard", the class returns "ComposeRules". IntelliJ requires them to match, so the inspection is dropped by LocalInspectionsPass and never runs.

Changed getShortName() to "ComposeGuard" (matches plugin id, configurable id, tool window id, and the @Suppress("ComposeGuard:...") syntax in the README).

Added a test that parses plugin.xml and asserts the registered shortName equals the class value.

ComposeGuardInspection.getShortName() returned "ComposeRules" while
plugin.xml registers shortName="ComposeGuard". The mismatch makes
InspectionToolWrapper.getTool() throw PluginException on every
LocalInspectionsPass, so the inspection never runs and idea.log
fills with stacktraces.

Align the class return value with plugin.xml and add a test that
parses plugin.xml to guard against future drift.
@timkrest timkrest requested a review from AndroidPoet as a code owner May 27, 2026 19:38
@AndroidPoet AndroidPoet merged commit e8a036c into AndroidPoet:master May 27, 2026
@AndroidPoet
Copy link
Copy Markdown
Owner

@timkrest Really appreciate this man,Thanks for taking the time to fix it 🙌

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.

2 participants