Expand description
Workspace-contains glob matcher for VS Code workspaceContains:<pattern>
activation events.
Matching semantics mirror VS Code’s ExtensionService.scanExtensions:
- Bare filename → exact match at workspace root
- Path with slashes → direct descendant match
**/pattern→ any descendant up to depth 3- Single
*→ one path segment wildcard
Bounded to depth 3 and 4096 entries per root so activation checks stay sub-100 ms on large monorepos.
Functions§
- Find
Matching Workspace Contains Patterns - Return the subset of
Patternsfor which at least one workspace folder contains a matching file or directory. - Pattern
Matches AnyEntry - Check whether
Patternmatches any entry inEntries. Supports literal paths,*(one segment), and**(any segments). Case-sensitive per the VS Code spec. - Segment
Match - Recursive segment-by-segment glob match.
**consumes zero or more path segments;*matches exactly one segment viaSingleSegmentMatch. - Single
Segment Match - Match a single path segment against a pattern that may contain
*.?is not supported (rare in workspaceContains patterns) and falls through to literal equality.