提交 2043fc7c 编写于 作者: J Johannes Rieken

fix #48745

上级 4a4faf1a
......@@ -270,18 +270,13 @@ class DecorationProviderWrapper {
const key = uri.toString();
let item = this.data.get(key);
if (isThenable<void>(item)) {
// pending -> still waiting
return;
}
if (item === undefined) {
// unknown -> trigger request
item = this._fetchData(uri);
}
if (item) {
// found something
if (item && !isThenable<void>(item)) {
// found something (which isn't pending anymore)
callback(item, false);
}
......
......@@ -206,6 +206,34 @@ suite('DecorationsService', function () {
assert.equal(cancelCount, 1);
assert.equal(callCount, 2);
reg.dispose();
});
test('Decorations not bubbling... #48745', function () {
let resolve: Function;
let reg = service.registerDecorationsProvider({
label: 'Test',
onDidChange: Event.None,
provideDecorations(uri: URI) {
if (uri.path.match(/hello$/)) {
return { tooltip: 'FOO', weight: 17, bubble: true };
} else {
return new TPromise<IDecorationData>(_resolve => resolve = _resolve);
}
}
});
let data1 = service.getDecoration(URI.parse('a:b/'), true);
assert.ok(!data1);
let data2 = service.getDecoration(URI.parse('a:b/c.hello'), false);
assert.ok(data2.tooltip);
let data3 = service.getDecoration(URI.parse('a:b/'), true);
assert.ok(data3);
reg.dispose();
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册