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
2026-06-16 12:16:00 -05:00
committed by GitHub
parent 2f6316500d
commit f34f606342
11 changed files with 2081 additions and 47 deletions
+13
View File
@@ -86,6 +86,19 @@ export const javaExtractor: LanguageExtractor = {
}
return false;
},
// A `static final` field is a Java constant (`MAX_ITEMS`, lookup tables,
// shared config). Drives `constant` kind so value-reference edges target it;
// instance / `final`-only / `static`-only fields stay mutable `field`s.
isConst: (node) => {
for (let i = 0; i < node.childCount; i++) {
const child = node.child(i);
if (child?.type === 'modifiers') {
const text = child.text;
return /\bstatic\b/.test(text) && /\bfinal\b/.test(text);
}
}
return false;
},
extractImport: (node, source) => {
const importText = source.substring(node.startIndex, node.endIndex).trim();
const scopedId = node.namedChildren.find((c: SyntaxNode) => c.type === 'scoped_identifier');