mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-27 10:37:38 +01:00
add skipped test for https://github.com/microsoft/vscode/issues/99504
This commit is contained in:
@@ -229,7 +229,7 @@ export class SuggestModel implements IDisposable {
|
||||
if (supports) {
|
||||
// keep existing items that where not computed by the
|
||||
// supports/providers that want to trigger now
|
||||
const items: CompletionItem[] | undefined = this._completionModel ? this._completionModel.adopt(supports) : undefined;
|
||||
const items = this._completionModel?.adopt(supports);
|
||||
this.trigger({ auto: true, shy: false, triggerCharacter: lastChar }, Boolean(this._completionModel), supports, items);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -791,4 +791,61 @@ suite('SuggestModel - TriggerAndCancelOracle', function () {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
test('Trigger (full) completions when (incomplete) completions are already active #99504', function () {
|
||||
this.skip();
|
||||
|
||||
disposables.push(CompletionProviderRegistry.register({ scheme: 'test' }, {
|
||||
provideCompletionItems(doc, pos) {
|
||||
return {
|
||||
incomplete: true,
|
||||
suggestions: [{
|
||||
kind: CompletionItemKind.Class,
|
||||
label: 'Z aaa',
|
||||
insertText: 'Z aaa',
|
||||
range: new Range(1, 1, pos.lineNumber, pos.column)
|
||||
}],
|
||||
};
|
||||
}
|
||||
}));
|
||||
disposables.push(CompletionProviderRegistry.register({ scheme: 'test' }, {
|
||||
provideCompletionItems(doc, pos) {
|
||||
return {
|
||||
incomplete: false,
|
||||
suggestions: [{
|
||||
kind: CompletionItemKind.Folder,
|
||||
label: 'aaa',
|
||||
insertText: 'aaa',
|
||||
range: getDefaultSuggestRange(doc, pos)
|
||||
}],
|
||||
};
|
||||
},
|
||||
}));
|
||||
|
||||
return withOracle(async (model, editor) => {
|
||||
|
||||
await assertEvent(model.onDidSuggest, () => {
|
||||
editor.setValue('');
|
||||
editor.setSelection(new Selection(1, 1, 1, 1));
|
||||
editor.trigger('keyboard', Handler.Type, { text: 'Z' });
|
||||
|
||||
}, event => {
|
||||
assert.equal(event.auto, true);
|
||||
assert.equal(event.completionModel.items.length, 1);
|
||||
assert.equal(event.completionModel.items[0].textLabel, 'Z aaa');
|
||||
});
|
||||
|
||||
await assertEvent(model.onDidSuggest, () => {
|
||||
// started another word: Z a|
|
||||
// item should be: Z aaa, aaa
|
||||
editor.trigger('keyboard', Handler.Type, { text: ' a' });
|
||||
}, event => {
|
||||
assert.equal(event.auto, true);
|
||||
assert.equal(event.completionModel.items.length, 2);
|
||||
assert.equal(event.completionModel.items[0].textLabel, 'Z aaa');
|
||||
assert.equal(event.completionModel.items[1].textLabel, 'aaa');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user