microsoft / microsoft/monaco-editor

[Bug] Inline suggestion interaction with empty autocomplete broke after 0.41

Open
#4,703 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug suggest
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

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.41.0#XQAAAAJRAwAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw4FRrCnGBGpWlpVktocO7_BJCkQTDFxvol36GvVmJLcE84C3knSa45xr2hL4V0Vd8zV6Ld144gL7NITm3WKlHwmiyD-4SVFQYQgvxqbpgmWbogQr5-7RHNWr3xYmY6BU_QqN8DOWwRxMFTKMcoT6kDUNKC9LlS0acSs08_34w0guFIJNMWi1reKkVSN9_-O91boq-2hlVbhlVgLbxXTyFxVJoG5f5Hmfd87Yi8NZqpNJcrfxPSDMUHpJEjwVTMtiEkheggJmhg9OY5OGOHeWaME8tkfP2n6g5OO5khv5VpA0VN5II6Xl1woHMQLMyIlY7DZppuNoBFTJQ6_siBAslXYAAfv74U9SzXwifTzCWnfreweIqDr1k__AlzJOSVXMDSaT-zTedXXtUAcMaRqsWOL4cUpH0gCqviU008p_89pj_qi1TTg

Monaco Editor Playground Code
monaco.languages.registerInlineCompletionsProvider("json", {
	provideInlineCompletions: function (model, position, context, token) {
		console.log('Provide new completion', position, context, token)
		return {items: [
                    {
                        insertText: 'chenfan'
                    },
                    {
                        insertText: 'hello world'
                    }
                ]};
	},
	freeInlineCompletions: function (completions) {
		console.log(completions);
	},
});
monaco.languages.registerCompletionItemProvider('json', {
    provideCompletionItems: () => {
        return {
            suggestions: [
            ]
        };
    }
});

monaco.editor.create(document.getElementById("container"), {
	value: '',
	language: "json",
});
Reproduction Steps

See the video

Actual (Problematic) Behavior

Cannot accept the inline suggestion when an empty suggest list shows

Expected Behavior

Can accept inline suggest if the auto compelte suggest list is not empty

Additional Context

https://github.com/user-attachments/assets/362d8322-93df-426a-806d-84da8632dc0c

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Monaco Editor Playground configuration and reproduce the interaction using the registered inline completions and completion-item providers. Trace how an empty autocomplete suggestion list affects inline suggestion acceptance, then verify that the inline suggestion can still be accepted when the list is empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.