boolean (List<? extends LocalInspectionTool> inspections, MyValidatorProcessingItem item, CompileContext context) { boolean hasErrors = !checkUnderReadAction(item, context, () -> myValidator.checkAdditionally(item.getPsiFile())); if (!checkUnderReadAction(item, context, () -> { PsiFile file = item.getPsiFile(); if (file instanceof XmlFile) { return runXmlFileSchemaValidation((XmlFile)file); } return Collections.emptyMap(); })) { hasErrors = true; } InspectionProfile inspectionProfile = myProfileManager.getCurrentProfile(); for (LocalInspectionTool inspectionTool : inspections) { if (!checkUnderReadAction(item, context, () -> { PsiFile file = item.getPsiFile(); if (file != null && getHighlightDisplayLevel(inspectionTool, inspectionProfile, file) != HighlightDisplayLevel.DO_NOT_SHOW) { return runInspectionTool(file, inspectionTool, getHighlightDisplayLevel(inspectionTool, inspectionProfile, file)); } return Collections.emptyMap(); })) { hasErrors = true; } } return !hasErrors; }