Skip to content

Commit b59f00f

Browse files
committed
fix (again) microsoft#133210
1 parent 3b6a33d commit b59f00f

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/vs/workbench/services/decorations/browser/decorationsService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export class DecorationsService implements IDecorationsService {
263263
}
264264

265265
registerDecorationsProvider(provider: IDecorationsProvider): IDisposable {
266-
const rm = this._provider.push(provider);
266+
const rm = this._provider.unshift(provider);
267267

268268
this._onDidChangeDecorations.fire({
269269
// everything might have changed

src/vs/workbench/services/decorations/test/browser/decorationsService.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,31 @@ suite('DecorationsService', function () {
300300
emitter.fire([uri]);
301301
});
302302
});
303+
304+
test('FileDecorationProvider intermittently fails #133210', async function () {
305+
306+
const invokeOrder: string[] = [];
307+
308+
service.registerDecorationsProvider(new class {
309+
label = 'Provider-1';
310+
onDidChange = Event.None;
311+
provideDecorations() {
312+
invokeOrder.push(this.label);
313+
return undefined;
314+
}
315+
});
316+
317+
service.registerDecorationsProvider(new class {
318+
label = 'Provider-2';
319+
onDidChange = Event.None;
320+
provideDecorations() {
321+
invokeOrder.push(this.label);
322+
return undefined;
323+
}
324+
});
325+
326+
service.getDecoration(URI.parse('test://me/path'), false);
327+
328+
assert.deepStrictEqual(invokeOrder, ['Provider-2', 'Provider-1']);
329+
});
303330
});

0 commit comments

Comments
 (0)