Reputation: 1395
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:
Upvotes: 1
Views: 566
Reputation: 1985
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
Upvotes: 4
Reputation: 7477
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).
Upvotes: 2