Skip to content

Commit c5bbe0a

Browse files
authored
Merge pull request microsoft#125484 from microsoft/hediet/fix-125478
trigger inline completions also on deleteLeft, deleteRight
2 parents 20cb29b + 7954c27 commit c5bbe0a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/vs/editor/contrib/inlineCompletions/inlineCompletionsModel.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { EditOperation } from 'vs/editor/common/core/editOperation';
1919
import { ICommandService } from 'vs/platform/commands/common/commands';
2020
import { EditorOption } from 'vs/editor/common/config/editorOptions';
2121
import { MutableDisposable } from 'vs/editor/contrib/inlineCompletions/utils';
22+
import { RedoCommand, UndoCommand } from 'vs/editor/browser/editorExtensions';
23+
import { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands';
2224

2325
export class InlineCompletionsModel extends Disposable implements GhostTextWidgetModel {
2426
protected readonly onDidChangeEmitter = new Emitter<void>();
@@ -36,7 +38,13 @@ export class InlineCompletionsModel extends Disposable implements GhostTextWidge
3638

3739
this._register(commandService.onDidExecuteCommand(e => {
3840
// These commands don't trigger onDidType.
39-
const commands = new Set(['undo', 'redo', 'tab']);
41+
const commands = new Set([
42+
UndoCommand.id,
43+
RedoCommand.id,
44+
CoreEditingCommands.Tab.id,
45+
CoreEditingCommands.DeleteLeft.id,
46+
CoreEditingCommands.DeleteRight.id
47+
]);
4048
if (commands.has(e.commandId) && editor.hasTextFocus()) {
4149
this.handleUserInput();
4250
}

0 commit comments

Comments
 (0)