microsoft / microsoft/monaco-editor
[Bug] Very first size calculation of resolved intellisense details is wrong (height not correct)
Open
@jrieken is already working on this.
Since Feb 16, 2023.
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?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
monaco.languages.registerCompletionItemProvider('csharp', {
provideCompletionItems: (model, position, context, token) => {
var word = model.getWordUntilPosition(position);
return {
suggestions: [
{
label: 'Method',
kind: monaco.languages.CompletionItemKind.Method,
insertText: 'Method',
detail: 'void Method(int i, int j, int k, int l, int m, int n, int o)',
documentation: {
value: 'Documentation1\n\nDocumentation2\n\nDocumentation3'
},
range: {
startLineNumber: position.lineNumber,
startColumn: word.startColumn,
endLineNumber: position.lineNumber,
endColumn: word.endColumn
}
}
]
};
}
});
const editor = monaco.editor.create(document.getElementById('container'), {
value: [
'class Test',
'{',
' ',
'}'
].join('\r\n'),
language: 'csharp'
});
Reproduction Steps
- Put cursor in line 3
- press
ctrl + space-> IntelliSense pops up - press
ctrl + spaceagain -> details pop up => In the details you cannot see "Documentation3". It is cut off and the overlay has a vertical scrollbar - press
ctrl + spaceagain -> details overlay closes - press
ctrl + spaceagain -> details pop up with correct size ("Documentation3" is visible from the start without scrolling)
Actual (Problematic) Behavior
On the very first IntelliSense call after loading a fresh editor, the size calculation of the details is wrong (see reproduction example)
Expected Behavior
On the first IntelliSense call after loading a fresh editor, the size of the details overlay should be correctly calculated.
Additional Context
It only seems to happen, if the "detail" get word-wrapped to a new line. If "detail" is a one-liner, the size calculation is correct.
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.
Assessment
This issue has not been assessed yet.