Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-duplicate cargo watch diagnostics #1438

Closed
wants to merge 2 commits into from
Closed

De-duplicate cargo watch diagnostics #1438

wants to merge 2 commits into from

Conversation

etaoins
Copy link
Contributor

@etaoins etaoins commented Jun 24, 2019

When building multiple targets (e.g. debug and test) it's common for the shared code to emit a diagnostic for each target. This is due to rust-lang/cargo#1534 and its many duplicates.

While this renders fine in the text view it can be confusing when looking at the error list or count.

This adds an areDiagnosticsEqual helper and then only pushes the new diagnostic if we haven't seen it before. This doesn't do a full proper equality; it only looks at the parts of the diagnostic we set. I couldn't find an appropriate helper function in the VSCode API.

When building multiple targets (e.g. debug and test) it's common for the
shared code to emit a diagnostic for each target. This is due to
rust-lang/cargo#1534 and its many duplicates.

While this renders fine in the text view it can be confusing when
looking at the error list or count.

This adds an `areDiagnosticsEqual` helper and then only pushes the new
diagnostic if we haven't seen it before. This doesn't do a full proper
equality; it only looks at the parts of the diagnostic we set. I
couldn't find an appropriate helper function in the VSCode API.
This is consistent with `getLevel`
@etaoins
Copy link
Contributor Author

etaoins commented Jun 25, 2019

Superseded by the much more ambitious #1439

@etaoins etaoins closed this Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant