开发者

Writing Intelli-J inspections?

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 p开发者_如何学Cer 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.


Late to the game, but this question still comes up high on a google search, so see:

http://confluence.jetbrains.com/display/IDEADEV/Inspection+of+Code+Source

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜