MhMadHamster / vscode-postcss-language

postcss syntax support extension for VSCode
MIT License
34 stars 7 forks source link

support for postcss-mixins #14

Closed jeremychone closed 7 years ago

jeremychone commented 7 years ago

We are using postcss-mixins and we are getting some highlighting errors.

image

Is that to be expected or something we should add/configure.

What would it take to add postcss-mixins support? We can try to see if we can help.

MhMadHamster commented 7 years ago

you can add "postcss.validate": false to the config, combined with smth like stylelint for custom validation, should work

jeremychone commented 7 years ago

Thanks very much for the quick replace. I get the postcssvalidate: false in the user config, but not sure about the combined with smth like styleint for custom validation. Not very familiar with it right now. Ideally, I would like to only exlude the @define-mixing and @mixin for validation and keep everything else, which I assume your proposal will take care of.

Any pointer for the "smth like styleint..."

jeremychone commented 7 years ago

So, it is interesting, in the postcss.tmLanguage file there is <string>@mixin|@function</string> so it seems to have some support for mixin. Just missing the @define-mixin support.

Is postcss.tmLanguagethe right place to add this support? (to still have the postcss validation but with mixin support) or am I missing something?

MhMadHamster commented 7 years ago

Well no, the .tmLanguage files have nothing to do with validation. And since there are some questions from time to time about validation in this plugin I'm feeling it is a necessity to shed some light on it. At first place, the plugin was made to provide syntax highlighting for postcss so you can use files with extension .css or .pcss or w'e and have syntax highlighting and the files being recognized by vscode as a postcss files, and that's what .tmLanguage files for. Later I've being asked to add validation, so here you go, you now have validation, tho it's very strict about any "postcss" only constructions like @define-mixin, @custom-media etc, and the reason for it: behind the scene, it's scss validator, and ideally it needs its own with the custom rules mentioned above. I'm honestly not planning to write separate validator for this plugin, partly because it would require time, partly because the plugin was made for syntax highlighting in the first place.

MhMadHamster commented 7 years ago

closing since question is answered

jeremychone commented 7 years ago

Sorry for the delay answer. Thank you for your details answer. Sorry for the confusion about the tmLanguage. I get it now and I can manage with turning validation off or looking at forking the scss validator, but as you said, it seems to be quite a bit of work.

Thanks a lot for this extension, it is very helpful.