Search code examples
intellij-ideajetbrains-idecode-inspection

IntelliJ Idea: How to create a custom inspection rule


I'm looking for the way to create inspection to warn about large non-javadoc comments in code. I didn't found any suitable common inspection to do this. It looks like I should create a custom inspection rule. Does anybody know how to do it?


Solution

  • As far as I know, there are two ways to create your own code inspection in IntelliJ IDEA:

    1. (simple but limited way) Creating custom inspection based on "search templates".
    2. (more complex and more powerfull way) Developing an IDEA-plugin (here are the guidlines) using your own InspectionToolProvider implementation as "application-component". Also you may use sources of my inspections-plugin as the starting point.