microsoft / typescript-lit-html-plugin

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

Attribute formatting breaks when not wrapped with " #18

Open ruphin opened 6 years ago

ruphin commented 6 years ago

highlighting-error

These are expected to be formatted the same way, but the formatting is broken when the attribute is not wrapped with ". The HTML specs allow bare attributes (without " wrapping), so the first example is valid, and should be formatted correctly.

justinfagnani commented 6 years ago

@mjbvz I tried to see if I could find out what's going on here, but my lack of experience build syntax definitions is slowing me down massively. I've been able to find the relevant parts of the HTML and TypeScript syntaxes that cover unquoted attribute values and template substitutions, but I can't figure out why the HTML definition is taking precedence, and can't find a way to introspect the scopes or tokens. I also can't find great documentation on controlling precedence and injections.

Any guidance? Thanks!

mjbvz commented 6 years ago

I think this part tracks just the formatting. Highlighting is tracked by https://github.com/mjbvz/vscode-lit-html/issues/46

You can use the inspect scope command to help debug highlighting issues

justinfagnani commented 6 years ago

oops. Thanks for the tip!