void () { configureByText(JavaFileType.INSTANCE, "class S {\n//ddd<caret>\n}"); StringBuffer log = new StringBuffer(); LineMarkerProvider provider = element -> { String msg = "provider.getLineMarkerInfo(" + element + ") called\n"; LineMarkerInfo<PsiComment> info = null; if (element instanceof PsiComment) { info = new LineMarkerInfo<>((PsiComment)element, element.getTextRange(), null, null, null, GutterIconRenderer.Alignment.LEFT); msg += " provider info: "+info + "\n"; } log.append(msg); return info; }; LineMarkerProviders.getInstance().addExplicitExtension(JavaLanguage.INSTANCE, provider, getTestRootDisposable()); myDaemonCodeAnalyzer.restart(); try { TextRange range = Objects.requireNonNull(FileStatusMap.getDirtyTextRange(myEditor.getDocument(), myFile, Pass.UPDATE_ALL)); log.append("FileStatusMap.getDirtyTextRange: " + range+"\n"); List<PsiElement> elements = CollectHighlightsUtil.getElementsInRange(getFile(), range.getStartOffset(), range.getEndOffset()); log.append("CollectHighlightsUtil.getElementsInRange: " + range + ": " + elements.size() +" elements : "+ elements+"\n"); List<HighlightInfo> infos = doHighlighting(); log.append(" File text: '" + getFile().getText() + "'\n"); log.append("infos: " + infos + "\n"); assertEmpty(filter(infos,HighlightSeverity.ERROR)); List<LineMarkerInfo<?>> lineMarkers = DaemonCodeAnalyzerImpl.getLineMarkers(myEditor.getDocument(), getProject()); assertOneElement(lineMarkers); type(' '); infos = doHighlighting(); log.append("File text: '" + getFile().getText() + "'\n"); log.append("infos: " + infos + "\n"); assertEmpty(filter(infos,HighlightSeverity.ERROR)); lineMarkers = DaemonCodeAnalyzerImpl.getLineMarkers(myEditor.getDocument(), getProject()); assertOneElement(lineMarkers); backspace(); infos = doHighlighting(); log.append("File text: '" + getFile().getText() + "'\n"); log.append("infos: " + infos + "\n"); assertEmpty(filter(infos,HighlightSeverity.ERROR)); lineMarkers = DaemonCodeAnalyzerImpl.getLineMarkers(myEditor.getDocument(), getProject()); assertOneElement(lineMarkers); } catch (AssertionError e) { System.err.println("Log:\n"+log+"\n---"); throw e; } }