File Watchers With Ignored Files

I am using WebStorm and I generally write my HTML files using Jade templates. I recently upgraded to WebStorm 11.
When writing Jade files, I prefix filenames with an underscore character if they are intended for inclusion within other Jade files. For these particular files, I do not want an HTML generated for them directly as they're intended to be used as includes within other Jade files.
Setting up a file watcher for Jade, these files have their HTML generated by default. So, I have created a scope for jade files that ignores those files that are prefixed with an _. Which is working great and exactly as I'd like it, with one exception.
If I alter the file with an _ prefix, I would like the parent Jade file to re-generate its HTML. WebStorm managed this fine in version 10, but it seems to be handling it differently in 11. I guess the watcher is just recognising that the file is ignored, and thus doesn't propagate the change to the parent file. Which I understand, but it's not really how I wanted it to behave.
I wondered if someone knew how I could set it up to get the behaviour I wanted?

4 comments
Comment actions Permalink

Actually WebStorm behaves as expected - changes made to files that are not in scope shouldn't trigger the watcher.

When 'Track only root files' is enabled in jade file watcher, any change made to main or partials trigger the watcher, but no separate files are  created for partials - only 'main' .html is generated. Did you try this option, instead of playing with scopes?

0
Comment actions Permalink

Hiya,
  Thanks for the reply.

> Actually WebStorm behaves as expected - changes made to files that are not in scope shouldn't trigger the watcher.

Yes indeed, I mention that I understand why it isn't triggering the watcher with my scope setup.

> When 'Track only root files' is enabled in jade file watcher, any change made to main or partials trigger the watcher, but no separate files are  created for partials - only 'main' .html is generated. Did you try this option, instead of playing with scopes?

Yes, this is the default setup. But if I return to that configuration, it is indeed now working as I expected. However, if I create a partial that hasn't yet been included then it generates the HTML for the jade file (I guess, as it's considered a root file as it hasn't been included yet). It would be nice if I could have it recognise the underscore prefix as a "don't generate the HTML for this".

However, it is behaving much more how I wanted it to with this setup. Thanks very much for pointing me back to that option!

0
Comment actions Permalink
However, if I create a partial that hasn't yet been included then it generates the HTML for the jade file (I guess, as it's considered a root file as it hasn't been included yet). It would be nice if I could have it recognise the underscore prefix as a "don't generate the HTML for this".


yes, exactly - file is not considered to be a partial unless it's included in other files. And changing this to recognize partials by name rather than by dependencies doesn't seem to be a good solution to me - '_' prefix is not even a standard for jade

0
Comment actions Permalink

Hiya,

> And changing this to recognize partials by name rather than by dependencies doesn't seem to be a good solution to me

I wasn't trying to suggest it should recognize the partial by it's underscore automatically, as you say, it is not a standard. More that it would be nice if there was someway of configuring it to.

But, it is a very minor thing, and I'm much happier after your help than I was with my scope configuration.

Thanks again!

0

Please sign in to leave a comment.