Fixes test.
This commit is contained in:
parent
60c88bb233
commit
f55f681b97
|
@ -35,7 +35,7 @@ export class InlineCompletionsModel extends Disposable implements GhostTextWidge
|
|||
constructor(
|
||||
private readonly editor: IActiveCodeEditor,
|
||||
private readonly cache: SharedInlineCompletionCache,
|
||||
private readonly commandService: ICommandService,
|
||||
@ICommandService private readonly commandService: ICommandService,
|
||||
) {
|
||||
super();
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ suite('Inline Completions', () => {
|
|||
});
|
||||
});
|
||||
|
||||
test('Does trigger automatically if disabled', async function () {
|
||||
test('Does not trigger automatically if disabled', async function () {
|
||||
const provider = new MockInlineCompletionsProvider();
|
||||
await withAsyncTestCodeEditorAndInlineCompletionsModel('',
|
||||
{ fakeClock: true, provider, inlineSuggest: { enabled: false } },
|
||||
|
@ -149,13 +149,14 @@ suite('Inline Completions', () => {
|
|||
async ({ editor, editorViewModel, model, context }) => {
|
||||
model.setActive(true);
|
||||
|
||||
context.keyboardType('foo');
|
||||
provider.setReturnValue({ text: 'foobar', range: new Range(1, 1, 1, 4) });
|
||||
context.keyboardType('foo');
|
||||
model.trigger();
|
||||
await timeout(1000);
|
||||
|
||||
provider.setReturnValue({ text: 'foobizz', range: new Range(1, 1, 1, 6) });
|
||||
context.keyboardType('bi');
|
||||
context.keyboardType('b');
|
||||
context.keyboardType('i');
|
||||
await timeout(1000);
|
||||
|
||||
assert.deepStrictEqual(provider.getAndClearCallHistory(), [
|
||||
|
@ -451,11 +452,6 @@ suite('Inline Completions', () => {
|
|||
{ position: '(1,5)', text: 'foob', triggerKind: 0, }
|
||||
]);
|
||||
assert.deepStrictEqual(context.getAndClearViewStates(), [
|
||||
/*
|
||||
TODO: Remove this flickering. Fortunately, it is not visible.
|
||||
It is caused by the text model updating before the cursor position.
|
||||
*/
|
||||
'foob',
|
||||
'foob[ar]',
|
||||
'foob[az]'
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue