diff --git a/internal/lsp/watcher/watcher.go b/internal/lsp/watcher/watcher.go index 5bd016eebe413a17acca29ef628612825d40b923..7297ff71fa43a79a9a821ffda261220bab210ddc 100644 --- a/internal/lsp/watcher/watcher.go +++ b/internal/lsp/watcher/watcher.go @@ -606,6 +606,9 @@ func (w *WorkspaceWatcher) matchesPattern(path string, pattern protocol.GlobPatt return fullPathMatch || baseNameMatch } + if basePath == "" { + return false + } // For relative patterns basePath = protocol.DocumentUri(basePath).Path() basePath = filepath.ToSlash(basePath)