gencer / SCSS-Everywhere

A Visual Studio Code extension that provides CSS class and ID atttribute completion with incremental build and usage explorer for the HTML class attribute based on the CSS/Template files in your workspace. Also supports React's className attribute.
https://marketplace.visualstudio.com/items?itemName=gencer.html-slim-scss-css-class-completion
MIT License
24 stars 9 forks source link

Auto caching only occurs when I save an SCSS file #70

Open LeeBuckle opened 3 years ago

LeeBuckle commented 3 years ago

Version: 1.7.8

I thought the plugin wasn't automatically caching but I noticed it only seems to work one way. i.e. saving a css/scss file, those classes get cached.

• Create new class in SCSS file then save, the new class will be suggested in JS or JSX file.

• Create new class in JSX file then save, cache isn't automatic and clicking lightening bolt required.

• Create new class in JS file (javascript and javascriptreact) and save, no caching at all, not even manual.

Is it possible to trigger automatic cache when a JSX file is saved? Additionally, can the plugin be made to cache normal JS files, or even just those with language mode javascriptreact? I tried adding 'js' to the glob pattern but that didn't seem to work.

Cheers 😁

gencer commented 3 years ago

Hey @LeeBuckle

Yes, Auto caching mechanism is only for Stylesheets not for other languages. We may do this in the future but there are still other open issues in my backlog. I am thinking to handle all of this issues including this one hopefully in 1-2 weeks. I was very busy with my own job and a bit lost on open-source projects.

Will work on this for sure but no promises about JS/X TS/X files because right now, I have no idea how this will impact the overall performance. But kinda doable...

Let me know if you have any other thoughts on this issue here.

LeeBuckle commented 3 years ago

No worries, just glad to know that you might be able to add the functionality.

If it happens to be expensive, maybe it could be added with a toggle in the options? That way it's up to the user and can easily be switched off if it causes them any trouble.

gencer commented 3 years ago

If it happens to be expensive, maybe it could be added with a toggle in the options? That way it's up to the user and can easily be switched off if it causes them any trouble.

That would be much better. 👍