void (@NotNull HighlightingSession session, @Nullable Editor editor, @NotNull List<? extends HighlightInfo> infos, @NotNull TextRange priorityRange, @NotNull TextRange restrictRange, int groupId) { PsiFile psiFile = session.getPsiFile(); Project project = session.getProject(); Document document = session.getDocument(); long modificationStamp = document.getModificationStamp(); TextRange priorityIntersection = priorityRange.intersection(restrictRange); TextEditorHighlightingPass showAutoImportPass = editor == null ? null : getOrCreateShowAutoImportPass(editor, psiFile, session.getProgressIndicator()); MarkupModelEx markupModel = (MarkupModelEx)DocumentMarkupModel.forDocument(document, project, true); if (priorityIntersection != null) { BackgroundUpdateHighlightersUtil.setHighlightersInRange(priorityIntersection, new ArrayList<HighlightInfo>(infos), markupModel, groupId, session); } ApplicationManager.getApplication().invokeLater(() -> { if (editor != null && !editor.isDisposed() && modificationStamp == document.getModificationStamp()) { // usability: show auto import popup as soon as possible if (!DumbService.isDumb(project)) { showAutoImportHints(session.getProgressIndicator(), showAutoImportPass); } repaintErrorStripeAndIcon(editor, project, psiFile); } }); }