Adding HTML context to JS language

I have a problem with Lit code. I’d like to use html context (proper indentions, autocompletion, comments etc.) within a template string in a Lit component (the same is for css context).

Lit code example:

...
  render() {
    return html`
      <div>
        <div>
        </div>
      </div>
    `
  }
...

So my question: is it possible to customize existing js language and specify rules for other languages context (e.g. html, css).

Thanks for any help!

Yes, you should be able to register new mixed parsers like this.

1 Like

It helped a lot, thanks