Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 699
Pazonec Avatar asked Dec 19 '22 10:12

Pazonec


2 Answers

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.
like image 94
Nolequen Avatar answered Jan 01 '23 18:01

Nolequen


See http://confluence.jetbrains.com/display/IDEADEV/Developing+Custom+Language+Plugins+for+IntelliJ+IDEA#DevelopingCustomLanguagePluginsforIntelliJIDEA-CodeInspectionsandIntentions. You can look at Open API and Plugin Development forum for assistance.

like image 28
lena Avatar answered Jan 01 '23 18:01

lena