Created
June 20, 2015 10:06
-
-
Save osxpeppermint/2acfee2179eb077ff2a2 to your computer and use it in GitHub Desktop.
HaxeLinter - Peppermint $Builtin (in CoffeeScript)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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