diff --git a/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts b/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts index ed7c68bda5..59c8420ca4 100644 --- a/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts +++ b/libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts @@ -20,6 +20,12 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli endColumn: position.column, }); + // abort if there is a signal + if (token.isCancellationRequested) { + console.log('aborted') + return { items: [] }; + } + const result = await this.props.plugin.call('copilot-suggestion', 'suggest', word) const generatedText = (result as any).output[0].generated_text as string console.log(word, result) @@ -31,12 +37,12 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli snippet: clean } }; - + // abort if there is a signal if (token.isCancellationRequested) { console.log('aborted') return { items: [] }; - } + } return { items: [item] }