void (@NotNull Document document, @NotNull Project project) { MarkupModel model = DocumentMarkupModel.forDocument(document, project, false); if (model == null) { return; } for (RangeHighlighter highlighter : model.getAllHighlighters()) { HighlightInfo info = HighlightInfo.fromRangeHighlighter(highlighter); if (info != null) { highlighter.dispose(); } } }