Closed Joeoeoe closed 1 year ago
Thank you so much for such kind words, Jonithan!
I considered that approach, and also getting the JSX tokens directly from Monaco's web worker, which was proposed a while back in Monaco's repo. However, that meant I had to hard code the JSX syntax in the former, or wait for the feature request to be implemented in the latter.
I would love the get the JSX tokens directly from Monaco, it does actually have them but they are not exposed via API (last time I checked was January 2021). In that way, we would not have to worry about providing our own tokenizers, and worse, maintaining them. Take, for instance, Fragments <></>
seems not to be considered by your tokenizer. Then, add JSX property, element, text, and other elements that may be added.
Interestingly, using Babel to get the AST, simplified what I had to handle, rather than tokens, I identify syntax expressions, which are easy to customize and provide comment actions.
I closed the issue, please feel free to continue the conversation.
Thank you for fixing the error in the documentation as well =)
You know what? It seems fun to push that path, I'll look into it, any help is welcome. At the time, I didn't have time (and still don't LOL), but we can get it start it.
Hi, David, your work is very wonderful. 🎉
But I am also curious about why not using custom languages for jsx/tsx hightlight? 🧐
for example in playground: https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages
Whth this config, I can add color to tag: