Suppress inspector violations?

I am trying to create a plugin for a framework that uses reflection to invoke methods that have a particular annotation.  Therefore from normal IDEA code analysis the public methods are not called from other java code, so the inspection reports them as unused.  I would like my plugin to veto this so that the methods don't get that inspector warning.  IDEA's Spring plugin does this today for methods that are marked as @Bean so I assume its not that difficult.  I have gone through the inspector APIs but can't find a place to inject a strategy to veto inspector violations.  Any suggestions?

1 comment

Should be possible using builtin inspection Declaration redundancy|Unused declaration. Click on "Configure annotations" and specify your annotations.
If you need/want to implement this in a plugin, you can use com.intellij.codeInsight.daemon.ImplicitUsageProvider

0

Please sign in to leave a comment.