Skip to content

Instantly share code, notes, and snippets.

@osxpeppermint
Created June 20, 2015 10:06
Show Gist options
  • Save osxpeppermint/2acfee2179eb077ff2a2 to your computer and use it in GitHub Desktop.
Save osxpeppermint/2acfee2179eb077ff2a2 to your computer and use it in GitHub Desktop.
HaxeLinter - Peppermint $Builtin (in CoffeeScript)
class HaxeLinter extends $Builtin
init:->
@startRun(1000);
run:->
doc = $Document.temp($Editor.content(),"hx","HaxeLinter");
$Terminal.execBg("haxe","--cwd", doc.folder, doc.filename, "--no-output",
(intermediate)=>,
(result)=>
lines = result.split("\n");
errors = [];
for line in lines
if line.trim()
p = line.replace(doc.filename,"").split(":");
errors.push({
column: 0,
row: parseInt(p[1])-1,
text: p[3].trim(),
type: "error"
});
$Editor.annotate(errors);
);
halt:->
$Editor.annotate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment