Skip to content

Commit

Permalink
feat: Added YAML language linter
Browse files Browse the repository at this point in the history
Add yaml linter

#3979 from asantos00/add-yaml-linter
  • Loading branch information
andrewnester authored Jun 28, 2022
2 parents f505879 + 56b591b commit 451f915
Show file tree
Hide file tree
Showing 6 changed files with 6,069 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ lib/ace/mode/php/*
lib/ace/mode/xml/*
lib/ace/mode/xquery/*
lib/ace/mode/xquery.js
lib/ace/mode/yaml/*
lib/ace/test/asyncjs/
lib/ace/lib/es5-shim.js
lib/ace/keyboard/vim*.js
Expand Down
16 changes: 16 additions & 0 deletions lib/ace/mode/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var TextMode = require("./text").Mode;
var YamlHighlightRules = require("./yaml_highlight_rules").YamlHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var FoldMode = require("./folding/coffee").FoldMode;
var WorkerClient = require("../worker/worker_client").WorkerClient;

var Mode = function() {
this.HighlightRules = YamlHighlightRules;
Expand Down Expand Up @@ -70,6 +71,21 @@ oop.inherits(Mode, TextMode);
this.$outdent.autoOutdent(doc, row);
};

this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/yaml_worker", "YamlWorker");
worker.attachToDocument(session.getDocument());

worker.on("annotate", function(results) {
session.setAnnotations(results.data);
});

worker.on("terminate", function() {
session.clearAnnotations();
});

return worker;
};


this.$id = "ace/mode/yaml";
}).call(Mode.prototype);
Expand Down
Loading

0 comments on commit 451f915

Please sign in to comment.