ace-ext-inline-annotator
v0.0.1
Published
Ace plugin to add inline annotations.
Downloads
5
Readme
Inline Annotator Plugin for Ace Editor
Ace plugin that can consume annotations and add them as dynamic markers to decorate error targets inline.
Getting Started
npm install ace-ext-inline-annotator
In the browser
<script src=""></script>
As an Ace module
import 'ace-ext-inline-annotator'
const InlineAnnotator = ace.require("ace/ext/inline_annotator").InlineAnnotator;
As an ES2015 module
import { InlineAnnotator } from 'ace-ext-inline-annotator';
Use with worker annotations
Extending the validation example from Ace:
var InlineAnnotator = require("ace/ext/inline_annotator").InlineAnnotator;
var WorkerClient = require("ace/worker/worker_client").WorkerClient;
this.createWorker = function(session) {
var inlineAnnotator = new InlineAnnotator(session);
var worker = new WorkerClient(["ace"], "path/to/worker", "WorkerModule");
worker.attachToDocument(session.getDocument());
worker.on("lint", function(results) {
session.setAnnotations(results.data);
inlineAnnotator.set(results.data);
});
worker.on("terminate", function() {
session.clearAnnotations();
});
return worker;
};