MCPcopy Index your code
hub / github.com/cursorless-dev/cursorless / patternFinder

Function patternFinder

src/util/nodeFinders.ts:127–138  ·  view source on GitHub ↗
(...patterns: string[])

Source from the content-addressed store, hash-verified

125}
126
127export function patternFinder(...patterns: string[]): NodeFinder {
128 const parsedPatterns = parsePatternStrings(patterns);
129 return (node: SyntaxNode) => {
130 for (const pattern of parsedPatterns) {
131 const match = tryPatternMatch(node, pattern);
132 if (match != null) {
133 return match;
134 }
135 }
136 return null;
137 };
138}
139
140function parsePatternStrings(patternStrings: string[]) {
141 return patternStrings.map((patternString) =>

Callers 8

valueMatcherFunction · 0.90
mapParityNodeFinderFunction · 0.90
clojure.tsFile · 0.90
patternMatcherFunction · 0.90
conditionMatcherFunction · 0.90
childAtIndexMatcherFunction · 0.90
leadingMatcherFunction · 0.90
trailingMatcherFunction · 0.90

Calls 2

parsePatternStringsFunction · 0.85
tryPatternMatchFunction · 0.85

Tested by

no test coverage detected