[Bug] Color picker / provider broken (not showing)
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
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 Code
// NOTE: This is copied directly from the Color Provider example:
// https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-color-provider-example
monaco.languages.register({
id: 'colorLanguage'
});
monaco.editor.create(document.getElementById('container'), {
value: 'red\nblue\ngreen',
language: 'colorLanguage',
colorDecorators: true
});
monaco.languages.registerColorProvider('colorLanguage', {
provideColorPresentations: (model, colorInfo) => {
var color = colorInfo.color;
var red256 = Math.round(color.red * 255);
var green256 = Math.round(color.green * 255);
var blue256 = Math.round(color.blue * 255);
var label;
if (color.alpha === 1) {
label = 'rgb(' + red256 + ', ' + green256 + ', ' + blue256 + ')';
} else {
label = 'rgba(' + red256 + ', ' + green256 + ', ' + blue256 + ', ' + color.alpha + ')';
}
return [
{
label: label
}
];
},
provideDocumentColors: () => {
return [
{
color: { red: 1, blue: 0, green: 0, alpha: 1 },
range: {
startLineNumber: 1,
startColumn: 0,
endLineNumber: 1,
endColumn: 0
}
},
{
color: { red: 0, blue: 1, green: 0, alpha: 1 },
range: {
startLineNumber: 2,
startColumn: 0,
endLineNumber: 2,
endColumn: 0
}
},
{
color: { red: 0, blue: 0, green: 1, alpha: 1 },
range: {
startLineNumber: 3,
startColumn: 0,
endLineNumber: 3,
endColumn: 0
}
}
];
}
});
Actual Behavior
The color picker is not displayed.
Expected Behavior
The color picker should pop up on hover.
Additional Context
No response
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
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.
More from microsoft/monaco-editor
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
microsoft/monaco-editor#5314 · 2 comments · 4 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
microsoft/monaco-editor#5248 · 8 comments · 57 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
microsoft/monaco-editor#5193 ·
-
[Bug] colorizeElement method doesn't color the whole text if domNode has more than one #text child Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/monaco-editor#4571 ·
-
bug help wanted integration
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/monaco-editor#4045 · 8 comments · 11 reactions ·
All issues in microsoft/monaco-editor
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100