microsoft / microsoft/monaco-editor
[Bug] Tab only accept the empty space
Nobody has claimed this yet.
- 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?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
monaco.languages.registerInlineCompletionsProvider("sql", {
provideInlineCompletions: function (model, position, context, token) {
console.log('Provide new completion', position, context, token)
return {items: [
{
insertText: ' buhao'
},
]};
},
freeInlineCompletions: function (completions) {
console.log(completions);
},
});
monaco.editor.create(document.getElementById("container"), {
value: 'SELECT\n *',
language: "sql",
});
Reproduction Steps
- Open the playground
- Type an enter
- You will see ' buhao' suggested
- Tab
- You will see empty space accepted
Actual (Problematic) Behavior
Tab can only accept empty space
Expected Behavior
Tab accept the full suggestion
Additional Context
https://github.com/microsoft/monaco-editor/assets/109033553/81f3a38b-1bd9-4201-8034-3e3b6bcf6ed7
Try on 0.43,0.44,0.47, all don't work. Have to mention, sometimes it works, sometimes it doesn't. Not sure what's the pattern
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Monaco Editor Playground link and the inline completions provider code in the issue. Reproduce the SQL example across the mentioned Monaco versions, focusing on how Tab handles the suggestion with leading spaces and the reported intermittent behavior. Done means Tab consistently accepts the full “ buhao” suggestion rather than only the empty space.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100