void () { final MarkupModel model = DocumentMarkupModel.forDocument(myDocument, myProject, true); for (RangeHighlighter highlighter : model.getAllHighlighters()) { if (highlighter.getUserData(KEY) == VALUE) { highlighter.dispose(); } } }