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

Function cascadingMatcher

src/util/nodeMatchers.ts:143–154  ·  view source on GitHub ↗
(...matchers: NodeMatcher[])

Source from the content-addressed store, hash-verified

141 * @returns A NodeMatcher that tries the given matchers in sequence
142 */
143export function cascadingMatcher(...matchers: NodeMatcher[]): NodeMatcher {
144 return (selection: SelectionWithEditor, node: SyntaxNode) => {
145 for (const matcher of matchers) {
146 const match = matcher(selection, node);
147 if (match != null) {
148 return match;
149 }
150 }
151
152 return null;
153 };
154}
155
156export const notSupported: NodeMatcher = (
157 selection: SelectionWithEditor,

Callers 5

typescript.tsFile · 0.90
csharp.tsFile · 0.90
go.tsFile · 0.90
clojure.tsFile · 0.90
python.tsFile · 0.90

Calls 1

matcherFunction · 0.85

Tested by

no test coverage detected