diff --git a/internal/lsp/manager.go b/internal/lsp/manager.go index f436b3cb3433d9c7e6c5ef28a3cff8bfa17f447f..5e238fda296a5e28034482a3a0b163ae1ae04d6c 100644 --- a/internal/lsp/manager.go +++ b/internal/lsp/manager.go @@ -303,8 +303,10 @@ func hasRootMarkers(dir string, markers []string) bool { return true } for _, pattern := range markers { - // Use fsext.GlobWithDoubleStar to find matches - matches, _, err := fsext.Glob(pattern, dir, 1) + // Use filepath.Glob for a non-recursive check in the root + // directory. This avoids walking the entire tree (which is + // catastrophic in large monorepos with node_modules, etc.). + matches, err := filepath.Glob(filepath.Join(dir, pattern)) if err == nil && len(matches) > 0 { return true }