What's the best way to add an error annotation to a Document? I need to do this for a custom plugin I'm writing. I found a method: UpdateHighlightersUtil.setHighlightersToEditor that sort of works, but I was wondering if there's a better way.
val annot = new Annotation(20, 30, HighlightSeverity.ERROR, "Test!", "Test Message!")
val info = HighlightInfo.fromAnnotation(annot)
val al = new ArrayList[HighlightInfo]()
UpdateHighlightersUtil.setHighlightersToEditor(project, doc, 20, 30, al, null, 0)