Skip to content

Commit 1fae598

Browse files
authored
* Fixes microsoft#166023 * Fixes test.
1 parent adcffbd commit 1fae598

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

src/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { compareBy, findMaxBy, numberComparator } from 'vs/base/common/arrays';
7-
import { RunOnceScheduler } from 'vs/base/common/async';
87
import { Emitter, Event } from 'vs/base/common/event';
98
import { Disposable } from 'vs/base/common/lifecycle';
109
import { IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';
@@ -39,16 +38,6 @@ export class SuggestWidgetInlineCompletionProvider extends Disposable {
3938

4039
public readonly onDidChange = this.onDidChangeEmitter.event;
4140

42-
// This delay fixes a suggest widget issue when typing "." immediately restarts the suggestion session.
43-
private readonly setInactiveDelayed = this._register(new RunOnceScheduler(() => {
44-
if (!this.isSuggestWidgetVisible) {
45-
if (this._isActive) {
46-
this._isActive = false;
47-
this.onDidChangeEmitter.fire();
48-
}
49-
}
50-
}, 100));
51-
5241
/**
5342
* Returns undefined if the suggest widget is not active.
5443
*/
@@ -126,8 +115,7 @@ export class SuggestWidgetInlineCompletionProvider extends Disposable {
126115
}));
127116
this._register(suggestController.widget.value.onDidHide(() => {
128117
this.isSuggestWidgetVisible = false;
129-
this.setInactiveDelayed.schedule();
130-
this.update(this._isActive);
118+
this.update(false);
131119
}));
132120
this._register(suggestController.widget.value.onDidFocus(() => {
133121
this.isSuggestWidgetVisible = true;

src/vs/editor/contrib/inlineCompletions/test/browser/suggestWidgetModel.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ suite('Suggest Widget Model', () => {
4848
assert.strictEqual(rangeStartsWith(new Range(1, 1, 10, 5), new Range(1, 1, 11, 4)), false);
4949
});
5050

51-
test('Active', async () => {
51+
// This test is skipped because the fix for this causes https://github.com/microsoft/vscode/issues/166023
52+
test.skip('Active', async () => {
5253
await withAsyncTestCodeEditorAndInlineCompletionsModel('',
5354
{ fakeClock: true, provider, },
5455
async ({ editor, editorViewModel, context, model }) => {

0 commit comments

Comments
 (0)