Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions internal/watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,27 +456,6 @@ func (w *WorkspaceWatcher) matchesPattern(path string, pattern protocol.GlobPatt

path = filepath.ToSlash(path)

// Special handling for wildcard patterns like "**/*"
if patternText == "**/*" {
// This should match any file
// watcherLogger.Debug("Using special matching for **/* pattern")
return true
}

// Special handling for wildcard patterns like "**/*.ext"
if strings.HasPrefix(patternText, "**/") {
if strings.HasPrefix(strings.TrimPrefix(patternText, "**/"), "*.") {
// Extension pattern like **/*.go
ext := strings.TrimPrefix(strings.TrimPrefix(patternText, "**/"), "*")
// watcherLogger.Debug("Using extension matching for **/*.ext pattern: checking if %s ends with %s", path, ext)
return strings.HasSuffix(path, ext)
} else {
// Any other pattern starting with **/ should match any path
// watcherLogger.Debug("Using path substring matching for **/ pattern")
return true
}
}

// For simple patterns without base path
if basePath == "" {
// Check if the pattern matches the full path or just the file extension
Expand Down
Loading