Inline annotations


#1

I’d like to add inline annotations around pieces of code, for example, show the a JSLint error directly underneath the offending line in a big red box.

Are there any provisions for this, or thoughts on how to accomplish it? One thing I’ve tried is getting the line element and applying a class to add a pseudo element, but unfortunately the content gets treated as code and messes up the cursor badly, in addition to getting removed when the line scrolls away.

Coffee:

editorView = atom.workspaceView.getActiveView()
lineElement = editorView.lineElementForScreenRow(3)
console.log lineElement
lineElement.addClass('quarkbox-error')

And LESS:

.quarkbox-error:after {
  content: 'this is the error content';
  color: white;
  background: red;
  display: block;
}

What Is The Best Way To Get The Current Active EditorView?
#2

Even simpler would be something like Sublime’s “regions”, which allow you to style a line of code in a certain way, but don’t let you inject non-editable content.