Semantic highlighting does not appear to work (due to theming)
See original GitHub issue- I expect the first four characters to be highlighted but nothing happens.
- There is no documentation really for any of the functions but
releaseDocumentSemanticTokens
in particular is not clear to me what I should be doing there.
monaco.languages.register({
id: 'new'
});
monaco.languages.registerDocumentSemanticTokensProvider('new', {
getLegend: () => {
return {
tokenModifiers: [],
tokenTypes: [
"keyword"
]
}
},
provideDocumentSemanticTokens: () => {
return {
data: [
0, 0, 4, 0, 0
]
}
},
releaseDocumentSemanticTokens: () => {
}
});
monaco.editor.create(document.getElementById("container"), {
value: "12345678",
language: "new"
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:15 (13 by maintainers)
Top Results From Across the Web
Syntax highlighting doesn't appear to work correctly - GitLab
This issue does seem related to Highlight.js, I think we can make some improvements like changing the colors of class names and methods...
Read more >How to enable semantic highlighting in VS Code - Stefan Judis
Semantic syntax highlighting makes sure your source code is not only beautifully colored, but that used the colors are logical, too.
Read more >C++ semantic syntax colorization not working at all since 2022 ...
The basic syntax highlighting works as normal (keywords etc), but semantic highlighting does not work at all, so pretty much all variables, ...
Read more >Typescript Semantic Highlighting not working (at all) [duplicate]
Found that the problem has already been discussed here, just gonna leave this question here, and make this duplicate.
Read more >Incorrect Semantic Highlighting colors when switching to dark ...
The same happens when manually switching themes. IntelliJ IDEA seems to remember the colors cor the semantic highlighting from the start-up theme and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see. Thanks for the update @alexdima!
Is there some way to (easily) make the respective
registerDocumentSemanticTokensProvider
calls for Monaco to treat things the same way as in VSC?Are there some plans to address this?
@aeschli @alexdima Now that microsoft/vscode#86415 has been finalized, can this be prioritized for April?