Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Uncaught context cancellation error when using an inline provider #4767

Open
1 of 2 tasks
rcjsuen opened this issue Dec 2, 2024 · 0 comments
Open
1 of 2 tasks

Comments

@rcjsuen
Copy link
Contributor

rcjsuen commented Dec 2, 2024

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.0#XQAAAAIHAgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw0ZaM6AEiAKctgAboa7AI8gn8BvNILczn-ntn_Op7J0iRiSJoSu8H-xEmbUTTxoDxiCFJnJB__-tl61bXWsYajlaxKSnlOpvUCnmPrnnXffnwnYRri2goI2pZOIVa4-lvv96se_l5fCIXld3qjIeDIH6yOKHZQUXq_vxTRha6CVReTK0AhPMNml7WO9U2AXhR63ewx2muJQD4NWSmjDnhnp5otSyhXXruKxFjIj-nIqQTLo6Jmckx1aYBBXQoJkxppW2fxcG7vo9zmziyDTTg9VjtbE9forAZvjbWo8JWTDL9TcLgdf1R3aQEEkgCfRdjTq6UaNauBbXSOtO3kphjmgXj23Fbkzw0l665avcf_5kNwAA

Monaco Editor Playground Code

const value = "";
const editor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "plaintext",
});

monaco.languages.registerInlineCompletionsProvider("plaintext", {
	provideInlineCompletions(model, position, context, token) {
		return {
			items: [
				{
					insertText: "abc"
				},
				{
					insertText: {
						snippet: "var variable = \"${1:value}\""
					}
				}
			]
		};
	},

	freeInlineCompletions() {

	}
});

Reproduction Steps

Browser: Google Chrome Version 131.0.6778.85 (Official Build) (arm64)
Operating System: macOS Sonoma 14.4

  1. Type v in the preview editor.
  2. The inline completion should appear.
  3. Hit the Tab key.
  4. An error will now appear in the browser console.
editor.main.js:52017 Uncaught (in promise) Canceled: Canceled
    at UniqueContainer.value (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:52017:24)
    at Emitter._deliver (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:12271:26)
    at Emitter.fire (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:12300:22)
    at MutableToken.cancel (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:12686:35)
    at CancellationTokenSource.cancel (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:12733:29)
    at Object.dispose (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:12754:40)
    at dispose (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:5534:27)
    at DisposableStore.clear (https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:5617:17)
    at https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:22304:19
    at https://microsoft.github.io/monaco-editor/node_modules/monaco-editor/dev/vs/editor/editor.main.js:22297:17

Actual (Problematic) Behavior

Error appears in the browser console.

Expected Behavior

There should be nothing in the browser console.

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant