mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-17 04:33:45 +00:00
Every R call site's CALLS source is now the callable that lexically contains it (named function, nested named function, R6/R5 method), or the File node when no named callable encloses it; a call in a class body outside any method (an R6 field default, a setClass validity body) is sourced from the Class node via the unchanged resolveCallerGraphId class-anchor fallback. Cause: R's @scope.function anchored only on the function_definition, while @declaration.function / @declaration.method anchor on the enclosing assignment / named argument. The def was therefore owned by the module / outer-function / Class scope, and resolveCallerGraphId credited every call in a body to the FIRST callable owned by that scope (false inner -> inner self-loops; module-level calls credited to a function instead of File). Fix (languages/r/query.ts only; no shared pipeline change, no @declaration.* change so def ids and resolveDefGraphId reconciliation are untouched): - (binary_operator lhs: (identifier) rhs: (function_definition)) @scope.function, directly beside the @declaration.function pattern it must track. - (argument name: (identifier) value: (function_definition)) @scope.function, directly beside the @declaration.method patterns; generic, so it cannot drift from the three R6/R5 nesting patterns, and inert for non-method arguments. - Both carry a "must stay in lockstep" comment; the blanket function_definition scope stays (anonymous functions); the query header rationale is rewritten. Cache: SCHEMA_BUMP is incremented (ledger comment added, pin test updated). Warm ParsedFiles and durable stores hold the pre-fix scope tree. Tests: removes every it.fails wrapper from the tests added in the previous commit (18 unit, 36 integration) and deletes the pins of the old, defective behaviour (5 unit, 4 integration); they now pass as ordinary tests. No other assertion was changed. Verification (built dist): scope-function-anchors 42/42, r.test.ts 97/97 (39 existing + 58 new), incremental-parse-cache, call-arguments-r, external-import-conformance, import-target-index-reuse.contract, the three grammar-literal gate files, tsc --noEmit clean. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| helpers | ||
| integration | ||
| unit | ||
| utils | ||