Skip to content

Commit ead4bec

Browse files
committed
fix: avoid diag info from other extension for tests
1 parent 198a175 commit ead4bec

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/client.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ export class Client {
106106
const range = new vscode.Range(err.startLine, err.startCol, err.endLine, err.endCol)
107107
const message = err.message
108108
const severity = vscode.DiagnosticSeverity.Warning
109-
return new vscode.Diagnostic(range, message, severity)
109+
const diag = new vscode.Diagnostic(range, message, severity)
110+
diag.source = 'float-pigment-css-analyzer'
111+
return diag
110112
})
111113
this.collection.set(uri, diagList)
112114
}

src/test/index.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ suite('common', () => {
2121
const uri = getUri('components/index.css')
2222
await vscode.window.showTextDocument(uri)
2323
await sleep(1000)
24-
assert.equal(vscode.languages.getDiagnostics(uri).length, 2)
24+
const diagList = vscode.languages
25+
.getDiagnostics(uri)
26+
.filter((diag) => diag.source === 'float-pigment-css-analyzer')
27+
assert.equal(diagList.length, 1)
2528
})
2629
})

0 commit comments

Comments
 (0)