Closed elquimista closed 6 years ago
I'll give it a try right on my machine. What package are you using for pug highlighting?
FYI, I couldn't even get the following working using your example in README.
style`div { display: block; }`
Hmm. The "style": "scope:source.css"
example works for me (I just tested it), but I can't get Pug to work. I checked the View -> Syntax menu and there's no Pug syntax listed, nor is it available via the command palette. I have the same Pug bundle installed. I think it might be a problem on that bundle's end. Is the Pug bundle working for you in any capacity?
Ah, I see the problem. The custom_tagged_literals
option embeds a modified version of the inner syntax inside your JS Custom syntax. However, the Pug syntax embeds your default JavaScript syntax inside itself. This causes unbounded recursion when Sublime tries to process the syntax definitions.
This problem most likely applies to any other syntax that includes the source.js
scope. I think that modifying the custom_tagged_literals
option to use Sublime's new embed
feature might fix the problem. However, the feature is only available in Sublime dev builds at this time. I'll look further into this and see what can be done in the short term.
Okay I see.
When I said "style": "scope:source.css"
didn't work for me, it was actually "pug": "scope:source.css"
that I tried (with pug tagged template string that contains css contents inside it). I switched language to default JavaScript as well. And the syntax highlighting didn't work.
To clarify, you're still having problems with highlighting CSS in template tags? To isolate that issue from the recursion issue with Pug:
JS Custom: Rebuild Syntaxes
from the command palette.This should make sure than any residual weirdness from the known Pug-related issue should be gone. Then, if it's not doing what you expect, post your JS Custom.sublime-settings
file and the code you're trying to highlight. I should be able to exactly reproduce the issue from there and fix it today.
There's nothing popping out when I type JS Custom: Rebuild Syntaxes
(or JSCustom: Rebuild Syntaxes
) in the command palette.
This should be fixed now. By default, the new embed_configuration
introduced in 1.0.15 disables custom_template_tags
. Please let me know if the problem recurs.
I tried to use this plugin to highlight react-pug syntax, using custom_tagged_literals option.
This is my settings:
But it doesn't work. I've been using babel-sublime, and it looked like this plugin was based in default ST JavaScript syntax, so I tried switching to that, but didn't work either.
What am I missing here?