Force file sync after file watcher runs - intellij-idea

I have a stylus file watcher that runs a custom script when a stylus file changes. I'd like to have webstorm/idea re-sync all stylus files after the command completes, but the "output paths to refresh" seems inadequate to the task. That is, it's looking for me to specify a path/file when possibly all stylus files have been updated.
Is there a syntax or option that would cause webstorm to update all files or all files with a specific extension after running a file watcher? If not, any other suggestions for triggering a re-sync (not manually) after executing a file watcher?
EDIT: WebStorm v9.0.3

Related

IntelliJ SASS file watcher doesn't detect changes in SCSS file

I have a style.sass file that #uses several _*.sass partials. That was all working fine. Now I added a _*.scss file (it just contains a map, so I wanted it to be multiline), but editing that file does not trigger a rebuild of the style.sass file. I tried adding a SCSS file watcher too, since I'm not sure how IntelliJ decides what to watch, but that didn't help.
It works fine using Dart-SASS's --watch argument. How do I make IntelliJ do the same?
(Although it's a Play project, I'm using IntelliJ's file watchers because I wanted to be able to use #use, so I needed Dart SASS.)
The watcher can only listen to changes in files of same type (either SASS or SCSS), depending on the watcher settings, so you can't make the watcher work for both .scss and .sass files at the same time unless you use a custom scope with both .sass and .scss files included and set File Type: to Any:

Use Intellij File Watcher only on Open File

I've been using the Intellij Golang plugin recently (it's great) but I've been running into an issue with the File Watchers I set up. My working directory is set to my $GOPATH directory and I would like to be able to run golint and goimports after I save a file I'm working on. The issue I have is if I use git to clone a repo the next time I open Intellij it runs both golint and goimports on all the newly imported files which can take a long time for large projects. Is there a way to set up File Watcher so it only watches a file that is currently open? I added a screenshot of my current settings below:
Open Watcher setting -> Scope , change it to Open Files
If you wanna more control over the plugin, you can have a look at the official doc
Instead of file watcher you can get External tools configured to achieve almost the same functionality. The only difference is that this won't run on save but rather you'll have to trigger this manually. Or you could configure a macro to run them on save (but I don't have experience with macros + external tools so I'm not if this will work).

How to trigger file watcher on a entire directory in Webstorm

I'm using Webstorm file watcher to compile my CoffeeScript.
My problem is that I have refactored the strutcure of my project's files.
Can I remove all files in /bin directory and tell to webstorm to apply his file watcher compile command on all .coffee files in a directory ? Because I don't want to open, modify and redo modification each file only for getting the compiled javascrit...
Yes, you can use 'Run file watchers' command to trigger a watcher for selected folder/project: just select a folder/project root, hit Ctrl+Shift+A -> type "run file " -> choose Run File Watchers.... You can assign custom shortcut for "Plugins | File Watchers | Run File Watchers" action in Settings | Keymap to make this procedure less complicated.

LESSC to compile to a custom path using environment variable

Bottom line I need lessc to compile my main.less file to $CATALINA_EC_TMP/main.css
I'm working on this project, where I need to generate multiple output css files originating from the same source (LESS file) using LESSC.
So with Jet Brain's (WebStorm or IntelliJ Idea) File Watcher, I don't get much of options to save the output files to a custom path using an environment variable.
The reason why I use an environment variable is because some of the outputted files is in a temporary path (it changes whenever I deploy with ant)
That said ...
This is my Environment Variable:
$CATALINA_EC_TMP = '/foo/bar/'
and it's changing so in the next deployment, it won't be /foo/bar/ anymore.
and this is the command line that's being executed by my IDE to compile less files
/usr/local/bin/lessc --no-color main.less
I need lessc to compile my main.less file to $CATALINA_EC_TMP/main.css
so the resulting file would be in that case /foo/bar/main.css or wherever the $CATALINA_EC_TMP value is.
I hope that there's a solution to this, anyway if it doesn't exist I think I'll use fswatcher to copy my generated css files into my destinations whenever I compile.

How to automatically upload compiled coffeescript files in Intellij IDEA?

I use automatic deploy through FTP. Everything worked well until I started to use coffeescript and its filewatcher feature which recompiles my .coffee file into .js file on every change.
Problem is that IDEA don't want to upload these compiled files like others. So I have manually press hotkey to upload compiled file after every change, which I want to see on the server.
How can I do it more convenient to use?
There is an option to upload external changes automatically.
Right now IDEA will not perform synchronization after file watcher is invoked, so you will need to do File | Synchronize, IDE will detect the changes and upload them.
Next update will have an option for the file watcher to perform synchronization after execution as the result of addressing this feature request.
this feature request concerns to a possibility to synchronize all files in output directory on every change (required by some transpilers). But, AFAIK, this is not the case for CoffeeScript compiler - synchronization should work there. Do the generated js files appear in the Project View as soon as the compilation completes, or do you have to synchronize the view manually to see changes? In the latter case something must be wrong with file watcher configuration (output path set incorrectly, for example). If files are synchronized correctly, setting 'upload external changes' option should do the thing