microsoft / microsoft/monaco-editor
Invalid completion items when using dots in completion item label
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
monaco-editor version: 0.20.0
Browser: Chrome
OS: Windows
Playground code that reproduces the issue:
function getSuggestions(range) {
return [
{
label: 'parameters.In1',
kind: monaco.languages.CompletionItemKind.Field,
insertText: 'parameters.In1',
insertTextRules: null,
range: range
}
];
}
monaco.languages.registerCompletionItemProvider('javascript', {
provideCompletionItems: function(model, position) {
return {
suggestions: getSuggestions(null)
};
}
});
monaco.editor.create(document.getElementById("container"), {
language: "javascript"
});
I was only able to reproduce this when registering a completion item provider which return completion items with dots in the label/insertText.
Repro steps:
- Execute the code above
- Type
paramand choose the optionparameters.In1 - Type again
type
Result: The completion menu shows an option "parameters" which was not returned by my provider neither exists in the Javascript language.
See the gif below:

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 playground reproduction and the registerCompletionItemProvider/provideCompletionItems entry points shown in the issue. Trace how a completion with a dotted label and insertText is processed after selection, then verify that typing again does not create an unregistered parameters item. No repository file or test is named in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100