Skip to content

Commit

Permalink
Don't show duplicate errors when go.buildOnSave is set to workspace. F…
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Oct 7, 2017
1 parent 610df69 commit b08eaf1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/goCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,11 @@ export function check(fileUri: vscode.Uri, goConfig: vscode.WorkspaceConfigurati
});
}

return Promise.all(runningToolsPromises).then(resultSets => [].concat.apply([], resultSets));
return Promise.all(runningToolsPromises).then(function(resultSets){
let results: ICheckResult[]=[].concat.apply([], resultSets);
// Filter duplicates
return results.filter((results, index, self) =>
self.findIndex((t) => {
return t.file === results.file && t.line === results.line && t.msg === results.msg && t.severity == results.severity; }) === index);
});
}

0 comments on commit b08eaf1

Please sign in to comment.