- Notifications
You must be signed in to change notification settings - Fork61
Add support for jsx html element highlights#57
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
TomiS commentedDec 30, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hmm, I realized this fails with code that uses html tag names as type names. Might be super hard to get around the fact that both jsx tags and types use chevrons now, assuming there is no deeper knowledge of the syntax tree. EDIT: After thinking about this a bit, unless there exists a significantly better approach, I would personally just accept that there are a few corner cases like this and still implement the highlight. The pros overweight the cons clearly. |
Whoever's reading this: make sure you've seen my comment at#8 (comment) first I'm open to consider coloring lower-cased JSX tags. But not if they discolor |
chenglou commentedFeb 3, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That could work, but requires detection the jsx block anyway. We already detect most of them, but don't highlight them, since highlighting them requires detectingall of them. Note how the ligature is already active. The troubling one is the open and closing angular brackets for the opening tag |
chenglou commentedFeb 3, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Btw@amiralies seehttps://github.com/rescript-lang/rescript-vscode/#recommendation and#8 (comment). |
is that the same exact tm grammar mapped to submile-syntax? |
It's the same, though for the example above I've tweaked a few things for clarity, ignore that. But the main point is that your theme (and mine, the default vscode dark theme) don't highlight stuff like operators. Yeah I'm familiar with the difference between the two grammars. Part of why I didn't lazy out with reusing TM grammar for Sublime is precisely because the new Sublime grammar is much nicer. |



I'm not sure if this is at all how you want to solve this. But since I spent some time toying with this approach, I might as well post it as a PR.
Some notes: