internal/lsp: fix GlobPattern for watching files
I noticed this wasn't working correctly when debugging issues with file
changes on disk. I think I misunderstood how to correctly match on
zero or more path segments. Confirmed that this is working as expected
with VS Code, but we really need regression tests for this in VS Code
(it seems to be based directly on VS Code's API). Filed
golang/vscode-go#404.
Change-Id: Ib906f73a97317dfa9bd30099877c90d4072651cc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/244605
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
diff --git a/internal/lsp/general.go b/internal/lsp/general.go
index c86dd04..dacce21 100644
--- a/internal/lsp/general.go
+++ b/internal/lsp/general.go
@@ -171,7 +171,7 @@
Method: "workspace/didChangeWatchedFiles",
RegisterOptions: protocol.DidChangeWatchedFilesRegistrationOptions{
Watchers: []protocol.FileSystemWatcher{{
- GlobPattern: fmt.Sprintf("%s/**.{go,mod,sum}", dir),
+ GlobPattern: fmt.Sprintf("%s/**/*.{go,mod,sum}", dir),
Kind: float64(protocol.WatchChange + protocol.WatchDelete + protocol.WatchCreate),
}},
},