Handling index use in FindUsagesHandler.getSecondaryElements

Answered

I have an implementation of FindUsagesHandler, and it needs to use indexes in getSecondaryElements, which is called on the EDT. Is there an API allowing me to calculate this information in a background thread, and then return the information? If not, how should I handle this?

0
4 comments

Hi Colin,

I can see that some implementations precompute the secondary elements and pass them while creating the handler. I suggest trying this approach.

0

Thanks Karol. Do you have an example of how this is done? I can't see any examples in the community source, and FindUsagesHandlerFactory#createFindUsagesHandler is also called on the EDT.

0

Hi Colin,

Sorry, I missed that the whole API is called on EDT. I've got information that it is a known platform issue, and there is a plan to move this out of EDT. Unfortunately, the timeframe for fixing it is unknown, so we have to patiently wait.

For the record (also for other readers), SlowOperation assertions are enabled only in internal mode, development instance, and EAP versions, and regular users don't see these exceptions.

0

Ok, thanks Karol. I actually wrapped the call in a SlowOperations.allowSlowOperations(SlowOperations.GENERIC), but that doesn't seem to work any more. Anyway, I'll wait for a solution, thanks.

0

Please sign in to leave a comment.