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

Function functionNameBasedFinder

src/languages/clojure.ts:103–114  ·  view source on GitHub ↗

* Matches a function call if the name of the function is one of the given names * @param names The acceptable function names * @returns The function call node if the name matches otherwise null

(...names: string[])

Source from the content-addressed store, hash-verified

101 * @returns The function call node if the name matches otherwise null
102 */
103function functionNameBasedFinder(...names: string[]) {
104 return (node: SyntaxNode) => {
105 const functionCallNode = functionCallFinder(node);
106 if (functionCallNode == null) {
107 return null;
108 }
109
110 const functionNode = getValueNodes(functionCallNode)[0];
111
112 return names.includes(functionNode?.text) ? functionCallNode : null;
113 };
114}
115
116function functionNameBasedMatcher(...names: string[]) {
117 return matcher(functionNameBasedFinder(...names));

Callers 2

functionNameBasedMatcherFunction · 0.85
clojure.tsFile · 0.85

Calls 1

getValueNodesFunction · 0.85

Tested by

no test coverage detected