void () { DaemonRespondToChangesTest.useAnnotatorsIn(JavaFileType.INSTANCE.getLanguage(), new DaemonRespondToChangesTest.MyRecordingAnnotator[]{new MyFileLevelAnnotator()}, () -> { configureFromFileText("x.java", """ class X { <caret> } """); ((EditorEx)getEditor()).getScrollPane().getViewport().setSize(new Dimension(1000,1000)); // whole file fit onscreen assertEmpty(highlightErrors()); List<HighlightInfo> fileLevel = ((DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(getProject())).getFileLevelHighlights(getProject(), getFile()); HighlightInfo info = assertOneElement(fileLevel); assertEquals("top level", info.getDescription()); type("\n\n"); assertEmpty(highlightErrors()); fileLevel = ((DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(getProject())).getFileLevelHighlights(getProject(), getFile()); info = assertOneElement(fileLevel); assertEquals("top level", info.getDescription()); type("//xxx"); //disable top level annotation List<HighlightInfo> warnings = doHighlighting(HighlightSeverity.WARNING); assertEmpty(warnings); fileLevel = ((DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(getProject())).getFileLevelHighlights(getProject(), getFile()); assertEmpty(fileLevel); }); }