void () { String text = "class X{\nint xxx;\n{\nint i = <selection>null</selection><caret>;\n" + StringUtil.repeat("{ this.hashCode(); }\n\n\n", 10000) + "}}"; configureByText(JavaFileType.INSTANCE, text); ((EditorImpl)myEditor).getScrollPane().getViewport().setSize(100, 100); DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(true); myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); ((EditorImpl)myEditor).getScrollPane().getViewport().setViewPosition(new Point(0, 0)); ((EditorImpl)myEditor).getScrollPane().getViewport().setExtentSize(new Dimension(100, 100000)); @NotNull Editor editor = getEditor(); ProperTextRange visibleRange = editor.calculateVisibleRange(); assertTrue(visibleRange.getLength() > 0); Document document = myEditor.getDocument(); assertTrue(visibleRange.getLength() < document.getTextLength()); HighlightInfo info = assertOneElement(highlightErrors()); final String errorDescription = "Incompatible types. Found: 'null', required: 'int'"; assertEquals(errorDescription, info.getDescription()); MarkupModelEx model = (MarkupModelEx)DocumentMarkupModel.forDocument(document, myProject, false); AtomicBoolean errorRemoved = new AtomicBoolean(); model.addMarkupModelListener(getTestRootDisposable(), new MarkupModelListener() { @Override public void afterRemoved(@NotNull RangeHighlighterEx highlighter) { HighlightInfo info = HighlightInfo.fromRangeHighlighter(highlighter); if (info == null) return; String description = info.getDescription(); if (errorDescription.equals(description)) { errorRemoved.set(true); List<ProgressableTextEditorHighlightingPass> passes = myDaemonCodeAnalyzer.getPassesToShowProgressFor(document); GeneralHighlightingPass ghp = null; for (TextEditorHighlightingPass pass : passes) { if (pass instanceof GeneralHighlightingPass && pass.getId() == Pass.UPDATE_ALL) { assert ghp == null : ghp; ghp = (GeneralHighlightingPass)pass; } } assertNotNull(ghp); boolean finished = ghp.isFinished(); assertFalse(finished); } } }); type("1"); assertEmpty(highlightErrors()); assertTrue(errorRemoved.get()); }