introduce utility method DumbService.isUsableInCurrentContext; replace usages

GitOrigin-RevId: 5ef82623debf3474bd9ed67829346f3d0f9967a3
This commit is contained in:
Alexey Kudravtsev
2024-05-03 14:58:01 +02:00
committed by intellij-monorepo-bot
parent e6472a2dd0
commit 02dcc5107b
42 changed files with 61 additions and 101 deletions

View File

@@ -251,9 +251,8 @@ public abstract class PsiAugmentProvider implements PossiblyDumbAware {
}
private static void forEach(Project project, Processor<? super PsiAugmentProvider> processor) {
boolean dumb = DumbService.isDumb(project);
for (PsiAugmentProvider provider : EP.getValue().getExtensionList()) {
if (!dumb || DumbService.isDumbAware(provider)) {
if (DumbService.getInstance(project).isUsableInCurrentContext(provider)) {
try {
boolean goOn = processor.process(provider);
if (!goOn) break;