FutureTask<Boolean> (@NotNull final PsiFile file, final boolean processChangedTextOnly) { return new FutureTask<>(() -> { if (!file.isValid()) return false; Collection<TextRange> ranges = getRanges(file, processChangedTextOnly); GlobalInspectionContextBase.cleanupElements(myProject, null, descriptor -> isInRanges(ranges, descriptor), file); return true; }); }