feat(extraction): same-file value-reference edges for impact analysis — 15 languages (#897)

Adds same-file value-reference edges (reader symbol → const/var it reads) so impact analysis catches a constant's same-file consumers, closing the 'change this table, break its readers' hole. 15 languages validated S/M/L on public OSS: TS/JS/tsx, Go, Python, Rust, Ruby, C, Java, C#, PHP, Scala, Kotlin, Swift, Dart, Pascal/Delphi (+ Svelte/Vue/Astro inherited). Edges-only — node count identical on/off; default ON, CODEGRAPH_VALUE_REFS=0 opts out.
This commit is contained in:
Colby Mchenry authored and GitHub committed 2026-06-16 12:16:00 -05:00
1 parent 2f6316500d
commit f34f606342
11 files changed
+2081 -47

No files matched your search

+7
View File
@@ -110,6 +110,13 @@ export const cExtractor: LanguageExtractor = {
nameField: 'declarator',
bodyField: 'body',
paramsField: 'parameters',
// A `const`/`static const` file-scope declaration carries a `type_qualifier`
// child reading "const" — extract those as `constant`, plain globals as
// `variable`.
isConst: (node) =>
node.namedChildren.some(
(c: SyntaxNode) => c.type === 'type_qualifier' && c.text === 'const'
),
getReturnType: extractCppReturnType,
resolveTypeAliasKind: (node, _source) => {
// C typedef: `typedef enum { ... } name;` or `typedef struct { ... } name;`