Handling index use in FindUsagesHandler.getSecondaryElements
已回答
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?
请先登录再写评论。
Hi Colin,
I can see that some implementations precompute the secondary elements and pass them while creating the handler. I suggest trying this approach.
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.
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.
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.