Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Filter duplicate compilation errors (#1269)
Browse files Browse the repository at this point in the history
* Don't show duplicate errors when go.buildOnSave is set to workspace. Fixes #1228

* Lint
  • Loading branch information
Alex Kohler authored and ramya-rao-a committed Oct 18, 2017
1 parent a8084e2 commit 2df2eff
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 2df2eff

Please sign in to comment.