void (@NotNull CompileScope scope) { CompileContextImpl context = null; try { context = createContext(scope); final BuildFSState fsState = myProjectDescriptor.fsState; for (BuildTarget<?> target : myProjectDescriptor.getBuildTargetIndex().getAllTargets()) { context.checkCanceled(); if (scope.isAffected(target)) { BuildOperations.ensureFSStateInitialized(context, target, true); final FilesDelta delta = fsState.getEffectiveFilesDelta(context, target); delta.lockData(); try { for (Set<File> files : delta.getSourcesToRecompile().values()) { for (File file : files) { if (scope.isAffected(target, file)) { // this will serve as a marker that compiler has work to do myMessageDispatcher.processMessage(DoneSomethingNotification.INSTANCE); return; } } } } finally { delta.unlockData(); } } } } catch (Exception e) { LOG.info(e); // this will serve as a marker that compiler has work to do myMessageDispatcher.processMessage(DoneSomethingNotification.INSTANCE); } finally { if (context != null) { flushContext(context); } } }