How would I go about writing my own Intelli-J inspection? I'm looking for some general guides or resources.
I want to bring up an inspection hint every time a collection class is instantiated manually, rather than through the Guava (List.newArrayList()/Maps.newHashMap()
) etc. as per a team-wide standard.
I'd appreciate any direction.
For such an inspection you don't need to write a plug-in, instead use the Structural Search and Replace (SSR) feature which allows to create custom inspections with quick fixes.
See also the Creating your own inspections section and documentation for this feature.
Note that it's available in the Ultimate version only.
I'll have to disappoint you but there are no written guidelines nor resources nor documentation for almost everything related to plug-ins and IntelliJ :(. (this is the main reason many IntelliJ fans haven't worked on plug-ins for their favorite tool).
That company makes fantastic products, but when it comes to documentation, books, and guidelines for developers (not users) - well, they're practically non-existing :(.
Your only bet is to take a look the source of actual IntelliJ plug-ins (some of them are here: http://git.jetbrains.org/) and ask very concrete questions on the IntelliJ plug-in list since the development team will gladly answer you usually in a matter of minutes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With