MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / createPatternMatchers

Function createPatternMatchers

src/util/nodeMatchers.ts:163–175  ·  view source on GitHub ↗
(
  nodeMatchers: Partial<Record<ScopeType, NodeMatcherAlternative>>
)

Source from the content-addressed store, hash-verified

161};
162
163export function createPatternMatchers(
164 nodeMatchers: Partial<Record<ScopeType, NodeMatcherAlternative>>
165): Record<ScopeType, NodeMatcher> {
166 Object.keys(nodeMatchers).forEach((scopeType: ScopeType) => {
167 let matcher = nodeMatchers[scopeType];
168 if (Array.isArray(matcher)) {
169 nodeMatchers[scopeType] = patternMatcher(...matcher);
170 } else if (typeof matcher === "string") {
171 nodeMatchers[scopeType] = patternMatcher(matcher);
172 }
173 });
174 return nodeMatchers as Record<ScopeType, NodeMatcher>;
175}

Callers 10

html.tsFile · 0.90
java.tsFile · 0.90
scala.tsFile · 0.90
typescript.tsFile · 0.90
cpp.tsFile · 0.90
json.tsFile · 0.90
csharp.tsFile · 0.90
go.tsFile · 0.90
clojure.tsFile · 0.90
python.tsFile · 0.90

Calls 2

patternMatcherFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected