Skip to content

Commit 2bc8b2b

Browse files
authored
Merge branch 'master' into master
2 parents 16e04f0 + fe9a2f8 commit 2bc8b2b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/features/diagnosticsProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ class DiagnosticsProvider extends AbstractSupport {
335335
let message = `${quickFix.Text} [${quickFix.Projects.map(n => this._asProjectLabel(n)).join(', ')}]`;
336336

337337
let diagnostic = new vscode.Diagnostic(toRange(quickFix), message, display.severity);
338+
diagnostic.source = 'csharp';
339+
diagnostic.code = quickFix.Id;
338340

339341
if (display.isFadeout) {
340342
diagnostic.tags = [vscode.DiagnosticTag.Unnecessary];

test/integrationTests/diagnostics.integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ suite(`DiagnosticProvider: ${testAssetWorkspace.description}`, function () {
4444
test("Return unnecessary tag in case of unnesessary using", async function () {
4545
let result = await poll(() => vscode.languages.getDiagnostics(fileUri), 15*1000, 500);
4646

47-
let cs8019 = result.find(x => x.message.includes("CS8019"));
47+
let cs8019 = result.find(x => x.source == "csharp" && x.code == "CS8019");
4848
expect(cs8019).to.not.be.undefined;
4949
expect(cs8019.tags).to.include(vscode.DiagnosticTag.Unnecessary);
5050
});
@@ -53,8 +53,8 @@ suite(`DiagnosticProvider: ${testAssetWorkspace.description}`, function () {
5353
this.skip(); // Remove this once https://github.com/OmniSharp/omnisharp-roslyn/issues/1458 is resolved.
5454
let result = await poll(() => vscode.languages.getDiagnostics(fileUri), 15*1000, 500);
5555

56-
let ide0005 = result.find(x => x.message.includes("IDE0005"));
57-
expect(ide0005).to.not.be(undefined);
56+
let ide0005 = result.find(x => x.source == "csharp" && x.code == "IDE0005");
57+
expect(ide0005).to.not.be.undefined;
5858
expect(ide0005.tags).to.include(vscode.DiagnosticTag.Unnecessary);
5959
});
6060
});

0 commit comments

Comments
 (0)