Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@shiki/monaco: it causes problems with parsing JSON styles #865

Open
3 of 5 tasks
norvancc opened this issue Dec 16, 2024 · 1 comment
Open
3 of 5 tasks

@shiki/monaco: it causes problems with parsing JSON styles #865

norvancc opened this issue Dec 16, 2024 · 1 comment

Comments

@norvancc
Copy link

norvancc commented Dec 16, 2024

Validations

Describe the bug

When I use workers in monaco, it causes problems with parsing JSON styles.
I want this:
image
But I got this:
image

As you can see that the colors of key and value are the same.

Strangely, it returned to normal after the hot update.

This is the demo code for Codesand Box, where you can reproduce the problem:
https://codesandbox.io/p/devbox/quizzical-nobel-y5qnzt?file=%2Fsrc%2Fmonaco.ts&workspaceId=ws_HXxUyJszDJTWzpaQX93E7n

Reproduction

https://codesandbox.io/p/devbox/quizzical-nobel-y5qnzt?file=%2Fsrc%2Fmonaco.ts&workspaceId=ws_HXxUyJszDJTWzpaQX93E7n

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@norvancc
Copy link
Author

By the way, I tried debugging and found that the tokenize only triggered once in shikiToMonaco.

monaco.languages.setTokensProvider(lang, {
  getInitialState() {
  ...
  },
  tokenize(line, state) {
  ...
  }
});

@norvancc norvancc changed the title When I use workers in monaco, it causes problems with parsing JSON styles @shiki:monaco: it causes problems with parsing JSON styles Dec 17, 2024
@norvancc norvancc changed the title @shiki:monaco: it causes problems with parsing JSON styles @shiki/monaco: it causes problems with parsing JSON styles Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant