ModCommand (@NotNull TextAttributesKey attributes, @NotNull PsiElement @NotNull ... elements) { if (elements.length == 0) return nop(); VirtualFile file = elements[0].getContainingFile().getVirtualFile(); var highlights = ContainerUtil.map( elements, e -> new ModHighlight.HighlightInfo(e.getTextRange(), attributes, true)); return new ModHighlight(file, highlights); }