Skip to content

Commit 7cf7cbf

Browse files
dbkegleyvirtuald
authored andcommitted
Remove duplicated glob matching logic
1 parent 67ed43e commit 7cf7cbf

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

internal/watcher/watcher.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -456,27 +456,6 @@ func (w *WorkspaceWatcher) matchesPattern(path string, pattern protocol.GlobPatt
456456

457457
path = filepath.ToSlash(path)
458458

459-
// Special handling for wildcard patterns like "**/*"
460-
if patternText == "**/*" {
461-
// This should match any file
462-
// watcherLogger.Debug("Using special matching for **/* pattern")
463-
return true
464-
}
465-
466-
// Special handling for wildcard patterns like "**/*.ext"
467-
if strings.HasPrefix(patternText, "**/") {
468-
if strings.HasPrefix(strings.TrimPrefix(patternText, "**/"), "*.") {
469-
// Extension pattern like **/*.go
470-
ext := strings.TrimPrefix(strings.TrimPrefix(patternText, "**/"), "*")
471-
// watcherLogger.Debug("Using extension matching for **/*.ext pattern: checking if %s ends with %s", path, ext)
472-
return strings.HasSuffix(path, ext)
473-
} else {
474-
// Any other pattern starting with **/ should match any path
475-
// watcherLogger.Debug("Using path substring matching for **/ pattern")
476-
return true
477-
}
478-
}
479-
480459
// For simple patterns without base path
481460
if basePath == "" {
482461
// Check if the pattern matches the full path or just the file extension

0 commit comments

Comments
 (0)