Change:
One desired behavior of writing a custom is that when the user accepts a given suggestion, the provider is immediately triggered again for another suggestion. We need to track when users accept (or reject) suggestions so that we can measure improvements that we make. Without using the experimental API, the best way to track if a completion is accepted is to provide a value for the field in . When supplying a command, the retriggering behavior is disabled [1]. As a workaround, I tried to indirectly trigger an inline completion via the command , however, it does not work (not sure why, this does work with my unit tests but not when I try to call it from a command I supply via ). [1] I believe this is the code block that retriggers automatically, one can see that the retrigger only happens if the command is the default command:
Note is related.
Note that [1] points to the autocomplete source code, not the inline suggestion feature. I'm not aware of any disablements.
Ok, that's incorrect -- however, adding a 'command' to disables the automatic retrigger.
Place the cursor after and press enter. Then accept. Notice that is not suggested.
That monaco repro / editor is really cool
Thanks! The best thing is that you can use the "Monaco Editor Playground" launch config in the VS Code repo to debug the playground example :)
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!

Discussion:
public async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor): Promise<void> { const controller = InlineCompletionsController.get(editor); <del> controller?.model.get()?.acceptNextWord(controller.editor); </del> <ins> await controller?.model.get()?.acceptNextWord(controller.editor); </ins> } }

public async run(accessor: ServicesAccessor | undefined, editor: ICodeEditor): Promise<void> { const controller = InlineCompletionsController.get(editor); <del> controller?.model.get()?.acceptNextLine(controller.editor); </del> <ins> await controller?.model.get()?.acceptNextLine(controller.editor); </ins> } }

} if (completion.command) { <del> await this._commandService .executeCommand(completion.command.id, ...(completion.command.arguments || [])) .then(undefined, onUnexpectedExternalError); </del> <ins> // Make sure the completion list will not be disposed. completion.source.addRef(); </ins> } <ins> // Reset before invoking the command, since the command might cause a follow up trigger. </ins> transaction(tx => { this._source.clear(tx); // Potentially, isActive will get set back to true by the typing or accept inline suggest event // if automatic inline suggestions are enabled. this._isActive.set(false, tx); }); <ins> if (completion.command) { await this._commandService .executeCommand(completion.command.id, ...(completion.command.arguments || [])) .then(undefined, onUnexpectedExternalError); completion.source.removeRef(); } </ins> } <del> public acceptNextWord(editor: ICodeEditor): void { this._acceptNext(editor, (pos, text) => { </del> <ins> public async acceptNextWord(editor: ICodeEditor): Promise<void> { await this._acceptNext(editor, (pos, text) => { </ins> const langId = this.textModel.getLanguageIdAtPosition(pos.lineNumber, pos.column); const config = this._languageConfigurationService.getLanguageConfiguration(langId); const wordRegExp = new RegExp(config.wordDefinition.source, config.wordDefinition.flags.replace('g', ''));

}); } <del> public acceptNextLine(editor: ICodeEditor): void { this._acceptNext(editor, (pos, text) => { </del> <ins> public async acceptNextLine(editor: ICodeEditor): Promise<void> { await this._acceptNext(editor, (pos, text) => { </ins> const m = text.match(/n/); if (m && m.index !== undefined) { return m.index + 1;

}); } <del> private _acceptNext(editor: ICodeEditor, getAcceptUntilIndex: (position: Position, text: string) => number): void { </del> <ins> private async _acceptNext(editor: ICodeEditor, getAcceptUntilIndex: (position: Position, text: string) => number): Promise<void> { </ins> if (editor.getModel() !== this.textModel) { throw new BugIndicatingError(); }

if (completion.snippetInfo || completion.filterText !== completion.insertText) { // not in WYSIWYG mode, partial commit might change completion, thus it is not supported <del> this.accept(editor); </del> <ins> await this.accept(editor); </ins> return; }