1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:24:42 -07:00

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>
This commit is contained in:
Rebecca Stambler 2020-07-25 00:37:20 -04:00
parent b5fc9d354d
commit 102e7d3570

View File

@ -171,7 +171,7 @@ func (s *Server) initialized(ctx context.Context, params *protocol.InitializedPa
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),
}},
},