void (Project project, Editor editor, TextRange[] ranges) { if (editor == null) return; ArrayList<RangeHighlighter> highlighters = new ArrayList<>(); HighlightManager highlightManager = HighlightManager.getInstance(project); for (TextRange range : ranges) { highlightManager.addRangeHighlight(editor, range.getStartOffset(), range.getEndOffset(), EditorColors.SEARCH_RESULT_ATTRIBUTES, false, highlighters); } }