My plugin adds a large number of local inspections, most of them with quick fixes. Inspections in the core IDE include those quick fixes in the hover tooltip, e.g.:
However, I’m not seeing the same behavior for my plugin’s inspections with quick fixes:
Here’s the context actions menu showing the available quick fix that’s not included in the hover tooltip above:
I could swear that this used to happen automatically, but I just tested as far back as 2024.1 and see the same issue.
Is there something specific I need to do with the quick fixes I’m adding to ensure they’re included in places other than the context actions menu?
UPDATE: It seems that this is true for only some of my plugin’s inspections and not others. So far I can’t seem to find a clear pattern, but I’ll keep looking. Anyone who knows off the top of their head, please feel free to let me know. Thanks!
UPDATE 2: I think I’ve figured it out. If the quick fix returns a value from getName()
that is HTML-formatted – and many(/most?) of mine do – that quick fix isn’t included in the hover tooltip. Is that expected? Is the only option “dumbing down” these getName()
return values to be unformatted?
UPDATE 3: Here’s the issue in DaemonTooltipActionProvider#getFirstAvailableAction()
:
//we cannot properly render html inside the fix button fixes with html text
if (!XmlStringUtil.isWrappedInHtml(text)) {
return action
}
I’ve actually implemented a semi-hackish way to make this work for both tooltip/unformatted and non-toolip/formatted requests…emphasis on the “hack”. But I’m going to move forward with it because I really like formatted quick fix labels when they can be used, but I also want these quick fixes to show up in tooltips. That’s worth the hack.