MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / getValVarName

Function getValVarName

src/extraction/languages/scala.ts:5–11  ·  view source on GitHub ↗
(node: SyntaxNode, source: string)

Source from the content-addressed store, hash-verified

3import type { LanguageExtractor } from '../tree-sitter-types';
4
5function getValVarName(node: SyntaxNode, source: string): string | null {
6 const patternNode = node.childForFieldName('pattern');
7 if (!patternNode) return null;
8 if (patternNode.type === 'identifier') return getNodeText(patternNode, source);
9 const identChild = patternNode.namedChildren.find((c: SyntaxNode) => c.type === 'identifier');
10 return identChild ? getNodeText(identChild, source) : null;
11}
12
13// Capitalized Scala primitives/ubiquitous aliases that shouldn't create refs.
14const SCALA_BUILTIN_TYPES = new Set([

Callers 1

scala.tsFile · 0.85

Calls 1

getNodeTextFunction · 0.90

Tested by

no test coverage detected