mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
merge tuples of equal Uri, #6373
This commit is contained in:
@@ -72,8 +72,19 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
||||
toSync = [];
|
||||
for (let entry of first) {
|
||||
let [uri, diagnostics] = entry;
|
||||
this._data[uri.toString()] = diagnostics;
|
||||
toSync.push(uri);
|
||||
if (!diagnostics) {
|
||||
// [Uri, undefined] means clear this
|
||||
delete this._data[uri.toString()];
|
||||
} else {
|
||||
// set or merge diagnostics
|
||||
let existing = this._data[uri.toString()];
|
||||
if (existing) {
|
||||
existing.push(...diagnostics);
|
||||
} else {
|
||||
this._data[uri.toString()] = diagnostics;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user