square/otto-intellij-plugin — pull request #2 by steveash (2013-10-24 05:10:23+00:00)
Title: Fixing some bugs and adding support for Guava event bus classes as well

Hi this pull request has the following:

1. there was a bug when displaying the line marker on bus.post() method invocations. The wrong PsiElement was being passed so the gutter icon would rarely show up
1. there was another bug on startup where it would scan for event classes and optimize the event index, and the scan is asynchronous. Thus, the optimize would often happen before the scan was complete. There is also a race condition where the editor line markers can be collected before the scan is done, resulting in the event class marker to not be placed. Once you do something to invalidate the editor it will correctly collect it. I added a "restart" for all event PsiClasses after the async scan completes, and that fixed the problem -- but I still think there's another lurking bug...
1. Improved the performance of line marker calculation for method expressions. We only care to do the expensive analysis if the method is at least called "post".
1. I refactored how the Bus and Subscribe class names were being handled so that I could add Guava support as well. Now it supports Otto and Guava. Note that Otto Bus posts will only show Otto subscribe methods (and vice-versa for Guava). Also when clicking the subscribe line marker for Guava, you aren't prompted for Producer methods, since those don't exist in Guava.

I tested this with Guava, and it works fine but I have not tested it with Otto.

I targeted IDEA 12 in my local environment and I noticed that you had targeted an earlier version. I'm not sure if I used anything that isn't available. I noticed that Guava is apparently available in the IDEA SDK so I used that. I have not done a lot of IDEA plugin work so its possible I made some obvious gaffs.

Thanks,

Steve