microsoft / typescript-lit-html-plugin

TypeScript server plugin that adds intellisense for lit-html template strings
MIT License
255 stars 21 forks source link

lit-html.tags does not control syntax highlighting #31

Open dbatiste opened 5 years ago

dbatiste commented 5 years ago

Trying to get syntax highlighting in css template strings in VS Code using extension. I've tried adding the following to settings.json but it doesn't seem to have any effect. I feel like I must be doing something incorrect... but then again, maybe not?

settings.json:

"lit-html.tags": [
    "html",
    "css"
]

for example, when using css template strings:

import { css } from 'lit-element/lit-element.js';

export const colors = css`
    :host {
        display: block;
        color: blue;
    }
    :host([hidden]) {
        display: none;
    }
`;
joakimbeng commented 5 years ago

Same issue here... I have a function with the name h and want its content to be syntax highlighted as html, my settings.json looks like:

"lit-html.tags": [
    "html",
    "h"
]

But e.g. h`<element attr="val"/>` does not get any syntax highlight. If I rename it to "html" its content instantly is colored... I've tried reinstalling and reloading VS Code multiple times with no luck.

mjbvz commented 5 years ago

lit-html.tags currently only controls intellisense, not highlighting. VS Code does not support dynamically generate grammars for syntax highlighting

gavinbarron commented 2 years ago

Would it be possible to support dynamic syntax highlighting via the new Semantic Token Provider? https://github.com/microsoft/vscode-docs/blob/main/api/language-extensions/syntax-highlight-guide.md#tokenization

Curious as I just ran into the highlighting limitation.

mpajer-gti commented 2 years ago

lit-html.tags currently only controls intellisense, not highlighting. VS Code does not support dynamically generate grammars for syntax highlighting

lit-html.tags is not working, not even setting lit-html.format.enabled as false is working. For some reason this plugin only uses config that was set in defaultConfiguration