Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Nov 11, 2021
1 parent cfebd1d commit bf523f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 8 additions & 3 deletions src/vs/workbench/api/browser/mainThreadDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ export class MainThreadDiagnostics implements MainThreadDiagnosticsShape {
private _forwardMarkers(resources: readonly URI[]): void {
const data: [UriComponents, IMarkerData[]][] = [];
for (const resource of resources) {
const markerData = this._markerService.read({ resource }).filter(marker => !this._activeOwners.has(marker.owner));
if (markerData.length > 0) {
data.push([resource, markerData]);
const allMarkerData = this._markerService.read({ resource });
if (allMarkerData.length === 0) {
data.push([resource, []]);
} else {
const forgeinMarkerData = allMarkerData.filter(marker => !this._activeOwners.has(marker.owner));
if (forgeinMarkerData.length > 0) {
data.push([resource, forgeinMarkerData]);
}
}
}
if (data.length > 0) {
Expand Down
10 changes: 3 additions & 7 deletions src/vs/workbench/test/browser/api/mainThreadDiagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ suite('MainThreadDiagnostics', function () {
await timeout(0);
assert.strictEqual(markerService.read().length, 2);
assert.strictEqual(changedData.length, 1);
assert.strictEqual(changedData[0].length, 1);
assert.strictEqual(changedData[0][0][1][0].message, 'forgein_owner');
});
});

test.skip('onDidChangeDiagnostics different behavior when "extensionKind" ui running on remote workspace #136955', function () {
test('onDidChangeDiagnostics different behavior when "extensionKind" ui running on remote workspace #136955', function () {
return runWithFakedTimers({}, async () => {

const markerData: IMarkerData = {
Expand Down Expand Up @@ -150,14 +151,9 @@ suite('MainThreadDiagnostics', function () {
}
);


diag.$clear('bar');

// added one marker via the API and one via the ext host. the latter must not
// trigger an event to the extension host

await timeout(0);
assert.strictEqual(markerService.read().length, 1);
assert.strictEqual(markerService.read().length, 0);
assert.strictEqual(changedData.length, 1);
});
});
Expand Down

0 comments on commit bf523f8

Please sign in to comment.