question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Semantic highlighting does not appear to work (due to theming)

See original GitHub issue
  1. I expect the first four characters to be highlighted but nothing happens.
  2. 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:open
  • Created 4 years ago
  • Reactions:4
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
schicklingcommented, Feb 5, 2021

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?

So this issue is not 100% done.

Are there some plans to address this?

1reaction
rcjsuencommented, Apr 2, 2020

@aeschli @alexdima Now that microsoft/vscode#86415 has been finalized, can this be prioritized for April?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found