Thomas Smith
Thomas Smith
Solving this via scoping would be tricky due to https://github.com/sublimehq/sublime_text/issues/2152.
Example: ```ts let x: string /** The production or development server. */ | number; ``` In the above case, the comment is within the type expression. In Example 1, it...
Example 3 has a workaround — use explicit terminators. ```ts export interface Foo { a: string; /** The resolved Nuxt configuration. */ b: number; } ```
Oof. Yeah, that's rough. Automatic semicolon insertion was a mistake and mandating it is nuts. Not sure if there's a reasonable workaround there, since relying on ASI makes everything harder...
The [JS Custom](https://github.com/Thom1729/Sublime-JS-Custom/) package lets you add [user-defined template tags](https://github.com/Thom1729/Sublime-JS-Custom/#custom_tagged_literals-object). In my opinion, this is a better approach than adding them to the core syntax.
JS Custom version 1.0.13 is out, updating the package for Sublime 3.1. More importantly, I've just fixed a *really egregious* bug in the documentation. Try this: ```json { "configurations": {...
Are you running Sublime 3.1? The new version of the core HTML syntax uses `embed`/`escape` instead of `push`/`with_prototype`, and that should avoid the infinite recursion.
Yes, you'd need to write: ```js template: html` ... ` ``` The JS Custom extension isn't designed to apply arbitrary highlighting to regular, untagged templates. You probably wouldn't want *all*...
The MDN reference explains in more detail. The "tag" of a template literal is a function that processes the literal's contents. So in this context, `html` should be a function...
I've figured it out. The underlying problem is that the HTML syntax is embedding the `source.js` scope, while the JS Custom syntax is embedding the HTML syntax using `with_prototype`. This...