dnwhte / vscode-mustache-syntax-highlighting

Syntax highlighting for mustache in VS Code.
https://marketplace.visualstudio.com/items?itemName=dawhite.mustache
MIT License
10 stars 5 forks source link

Syntax Highlighting for Mustache IF #4

Open dwsmyth opened 5 years ago

dwsmyth commented 5 years ago

Hi Dan, I am a big fan of logicless templates and mustache, so when I saw your syntax highlighting I jumped on it. I am having some difficulty with the syntax highlighting in Dark themes.

Here is a simple example of how using Mustache tags in a HTML document stops syntax highlighting. <input type="text" {{#is_read_only}}disabled{{/is_read_only}} name="test" value=""/>

In the Dark color schemes /is_read_only}} is highlighted in one color, but {{^is_read_only}} is in another.

dnwhte commented 5 years ago

I don't believe there is much I can do about this. It appears that vscode thinks there is a syntax error.

It adds the class mtk10 to the segment "{{/is_read_only}}" when it's in an html tag.

I see some have started adding their own stylesheets to override some of that stuff: https://gist.github.com/DoroGi/56d6091e4bfc30c933ce697ebf1649d4

If you're interested here are the vscode tests: https://github.com/Microsoft/vscode/blob/4c8e61c0499dfd7531ec99ab6723c1e4371ed2f3/src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts

I could be wrong, but to the best of my knowledge that's what is going on.

michaeljsalo commented 5 years ago

I am also using with VSCode dark themes, and can't tell if syntax highlighting is working right. Are open tags and close tags meant to show as different colors?

Screen Shot 2019-08-05 at 4 18 00 PM