Skip to content

Commit

Permalink
cmd/govim: starting watching changes to go.mod again (#594)
Browse files Browse the repository at this point in the history
Now that golang/go#32178 is fixed we can start
to watch changes to go.mod files and communicate those in the same way
that changes to .go files outside of the editor are.
  • Loading branch information
myitcv committed Nov 27, 2019
1 parent 2db04e5 commit c71e3b0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/govim/watcher.go
Expand Up @@ -117,8 +117,7 @@ func (m *modWatcher) watch() {
continue
}
if !dirInfo.IsDir() {
// Is Vim handling this file?
// Is this a file we care about? go.mod, *.go?
// Is Vim handling this file? Is this a file we care about?
if !ofInterest(path) {
continue
}
Expand Down Expand Up @@ -170,8 +169,7 @@ func (m *modWatcher) watch() {
}

func ofInterest(path string) bool {
// TODO when https://github.com/golang/go/issues/32178 is fixed re-add go.mod here
return filepath.Ext(path) == ".go"
return filepath.Ext(path) == ".go" || filepath.Base(path) == "go.mod"
}

func (v *vimstate) handleEvent(event fswatcher.Event) error {
Expand Down

0 comments on commit c71e3b0

Please sign in to comment.