Skip to content

Commit

Permalink
Process file every time it stops changing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmecham committed Oct 17, 2019
1 parent 84f090b commit 1fb7032
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Scripts/issuesProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class RuboCopIssuesProvider {
const relativePath = nova.workspace.relativizePath(document.path);
this.processFile(relativePath);

editor.onDidStopChanging(this.updateFile.bind(this));
editor.onDidDestroy(this.removeTextEditor.bind(this));

this.editors.push(editor);
}

Expand All @@ -50,6 +52,11 @@ class RuboCopIssuesProvider {
return this.offenses[relativePath].map(offense => offense.issue);
}

updateFile(editor) {
const relativePath = nova.workspace.relativizePath(editor.document.path);
this.processFile(relativePath);
}

processFile(path) {
const options = {
args: ["rubocop", "-fj", path],
Expand Down

0 comments on commit 1fb7032

Please sign in to comment.