microsoft / typescript-lit-html-plugin

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

Add quickfix support for embedded css blocks #15

Closed justinribeiro closed 6 years ago

justinribeiro commented 6 years ago

This PR adds quickfix support for the css within <style>. The approach is similar to the styled plugin, but instead of running doValidation on the entire document, it uses the getEmbeddedDocument('css') to only return the CSS portion so that the validation doesn't run on html tags and report incorrectly.

I've added three additional tests to validate the new behavior. The gif below is representative, though I did change the diagnostic source name to pluginName as opposed to the :fire: emoji. :-)

output

mjbvz commented 6 years ago

Neat! Will publish this and make sure it is properly included in the lit-html extension :)