| 3 | import type { LanguageExtractor } from '../tree-sitter-types'; |
| 4 | |
| 5 | function 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. |
| 14 | const SCALA_BUILTIN_TYPES = new Set([ |