allowSlowOperations deprecated?
Answered
Here's another one I stumbled upon. My plugin has to search for all files with certain extension within a project, e.g.
Collection<VirtualFile> libs = FilenameIndex.getAllFilesByExt(project, "libsonnet", GlobalSearchScope.allScope(project));
Previously I used to wrap this in SlowOperations.allowSlowOperations
but it is deprecated now - so what's the alternative?
Please sign in to leave a comment.
Hi Eugene,
There is no alternative to allowing slow operations. As the deprecation message states, they will be banned on the EDT (UI thread).
You should fix your code to not call slow operations on EDT. Please see
SlowOperations.assertSlowOperationsAreAllowed
doc for the details.