void () { myElement.setFileDescription(new DomFileDescription<>(DomElement.class, "a")); final MyDomElementsInspection inspection = new MyDomElementsInspection() { @Override public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) { myAnnotationsManager.appendProblems(myElement, createHolder(), this.getClass()); return ProblemDescriptor.EMPTY_ARRAY; } @Override public void checkFileElement(final @NotNull DomFileElement fileElement, final @NotNull DomElementAnnotationHolder holder) { } }; registerInspectionKey(inspection); myInspectionProfile.setInspectionTools(Collections.singletonList(new LocalInspectionToolWrapper(inspection))); myAnnotationsManager.appendProblems(myElement, createHolder(), MockAnnotatingDomInspection.getInspection()); assertEquals(DomHighlightStatus.ANNOTATORS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); myAnnotationsManager.appendProblems(myElement, createHolder(), inspection.getClass()); assertEquals(DomHighlightStatus.INSPECTIONS_FINISHED, myAnnotationsManager.getHighlightStatus(myElement)); }