-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
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
// Register a new language
monaco.languages.register({ id: "mySpecialLanguage" });
// Register a tokens provider for the language
monaco.languages.setMonarchTokensProvider("mySpecialLanguage", {
tokenizer: {
root: [
[/\[error.*/, "custom-error"],
[/\[notice.*/, "custom-notice"],
[/\[info.*/, "custom-info"],
[/\[[a-zA-Z 0-9:]+\]/, "custom-date"],
],
},
});
// Define a new theme that contains only rules that match this language
monaco.editor.defineTheme("myCoolTheme", {
base: "vs",
inherit: false,
rules: [
{ token: "custom-info", foreground: "808080" },
{ token: "custom-error", foreground: "ff0000", fontStyle: "bold" },
{ token: "custom-notice", foreground: "FFA500" },
{ token: "custom-date", foreground: "008800" },
],
colors: {
"editor.foreground": "#000000",
},
});
// Register a completion item provider for the new language
monaco.languages.registerCompletionItemProvider("mySpecialLanguage", {
provideCompletionItems: (model, position) => {
var word = model.getWordUntilPosition(position);
var range = {
startLineNumber: position.lineNumber,
endLineNumber: position.lineNumber,
startColumn: word.startColumn,
endColumn: word.endColumn,
};
var suggestions = [
{
label: "simpleText",
kind: monaco.languages.CompletionItemKind.Text,
insertText: "simpleText",
range: range,
},
{
label: "testing",
kind: monaco.languages.CompletionItemKind.Keyword,
insertText: "testing(${1:condition})",
insertTextRules:
monaco.languages.CompletionItemInsertTextRule
.InsertAsSnippet,
range: range,
},
{
label: "ifelse",
kind: monaco.languages.CompletionItemKind.Snippet,
insertText: [
"if (${1:condition}) {",
"\t$0",
"} else {",
"\t",
"}",
].join("\n"),
insertTextRules:
monaco.languages.CompletionItemInsertTextRule
.InsertAsSnippet,
documentation: {
value: "<span style='color:#3794ff;'>Test suggestion</span>",
supportHtml: true
},
range: range,
},
];
return { suggestions: suggestions };
},
});
monaco.editor.create(document.getElementById("container"), {
theme: "myCoolTheme",
language: "mySpecialLanguage",
});Reproduction Steps
- Open the playground with custom documentation with HTML code enabled playground
- Open NVDA with speech viewer on
- Open suggestion list by shortcut Ctrl+Space
- Press Ctrl+Space to open suggestion item details
- Move from and back to first item (ifelse) with suggestion documentation on to make NVDA read it. (There is bug about it Accessibility: NVDA does not read the suggestion details pane in the Monaco editor vscode#275851)
Actual (Problematic) Behavior
Screen reader reads the details with HTML elements
But if we click on details screen readers reads correct without any tags
Expected Behavior
The screen reader announces the content without HTML tags the same it does after click on it
Additional Context
Environment:
App: Monaco editor v.0.54.0
Browser: Google Chrome v.142.0.7444.61 (Official Build)
OS: Microsoft Windows 11 Enterprise v.0.0.22631 Build 22631
Screen reader NonVisual Desktop Access (NVDA) v.2025.3 (2025.3.0.52596)
Metadata
Metadata
Assignees
Labels
No labels