This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Duplicate diagnostics when running a task with the $go problemMatcher #2100
Closed
Description
opened on Nov 5, 2018
Steps to Reproduce
- Build any go package, when
go.buildOnSave
is enabled, with the following task definition:
{
"label": "build",
"type": "shell",
"command": "go build -v",
"problemMatcher": "$go",
"group": {
"kind": "build",
"isDefault": true
}
}
- Observe the duplicate errors.
Analysis
VS Code de-duplicates diagnostics based on their owner
. For tasks this is set in the problemMatcher
(The go
problem matcher is defined here: vscode/src/vs/workbench/parts/tasks/common/problemMatcher.ts:1798-1807). While for extensions this is the name of the DiagnosticCollection
(See vscode/src/vs/workbench/api/node/extHostDiagnostics.ts:258). In order for diagnostics generated by go.buildOnSave
to be de-duplicated with diagnostics generated by tasks we need to use a single DiagnosticCollection
, and name it go
.
P.S. We should also set Diagnostic.source
. It should be just go
for build tasks, and probably the name of the linter, for linters. I will open a separate issue for this. EDIT: Created #2101
Metadata
Assignees
Labels
No labels
Activity