Skip to content

Commit bf523f8

Browse files
committed
1 parent cfebd1d commit bf523f8

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/vs/workbench/api/browser/mainThreadDiagnostics.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@ export class MainThreadDiagnostics implements MainThreadDiagnosticsShape {
3737
private _forwardMarkers(resources: readonly URI[]): void {
3838
const data: [UriComponents, IMarkerData[]][] = [];
3939
for (const resource of resources) {
40-
const markerData = this._markerService.read({ resource }).filter(marker => !this._activeOwners.has(marker.owner));
41-
if (markerData.length > 0) {
42-
data.push([resource, markerData]);
40+
const allMarkerData = this._markerService.read({ resource });
41+
if (allMarkerData.length === 0) {
42+
data.push([resource, []]);
43+
} else {
44+
const forgeinMarkerData = allMarkerData.filter(marker => !this._activeOwners.has(marker.owner));
45+
if (forgeinMarkerData.length > 0) {
46+
data.push([resource, forgeinMarkerData]);
47+
}
4348
}
4449
}
4550
if (data.length > 0) {

src/vs/workbench/test/browser/api/mainThreadDiagnostics.test.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,12 @@ suite('MainThreadDiagnostics', function () {
107107
await timeout(0);
108108
assert.strictEqual(markerService.read().length, 2);
109109
assert.strictEqual(changedData.length, 1);
110+
assert.strictEqual(changedData[0].length, 1);
110111
assert.strictEqual(changedData[0][0][1][0].message, 'forgein_owner');
111112
});
112113
});
113114

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

117118
const markerData: IMarkerData = {
@@ -150,14 +151,9 @@ suite('MainThreadDiagnostics', function () {
150151
}
151152
);
152153

153-
154154
diag.$clear('bar');
155-
156-
// added one marker via the API and one via the ext host. the latter must not
157-
// trigger an event to the extension host
158-
159155
await timeout(0);
160-
assert.strictEqual(markerService.read().length, 1);
156+
assert.strictEqual(markerService.read().length, 0);
161157
assert.strictEqual(changedData.length, 1);
162158
});
163159
});

0 commit comments

Comments
 (0)