Commit e5fe754
committed
fix(resolver): recognize identifier args to user-defined higher-order functions via parameter type
extractCallbackReferenceCalls/extract_callback_reference_calls gated
identifier-argument dynamic calls on a name/position allowlist
(CALLBACK_ACCEPTING_CALLEES/POSITIONAL_CALLBACK_ARG_INDEX), which by
definition can never enumerate a project's own arbitrary higher-order
functions (e.g. processEach(users, logUser), where processEach's `fn`
parameter is typed as a function-shaped alias).
Add a same-file, TS-only signal: collectCallbackParamShapes walks each
file once to record, per function/method declaration, which parameter
positions carry a function-shaped type (inline arrow-function type,
`Function`, or a `type X = (...) => ...` alias resolved through one
level of indirection). extractCallbackReferenceCalls now allows an
identifier/member-expression argument through when the callee's own
parameter at that position is function-shaped, in addition to the
existing name/position allowlist. Mirrored in both engines (WASM walk
and query paths, native Rust).
Recovers the 3 callback edges intentionally dropped by #1741
(runCallbackDemo -> logUser/upperUser/hasEmail in the typescript
resolution fixture); typescript resolution-benchmark recall floor
ratcheted 0.72 -> 0.9 to lock in the fix.
Cross-file callees remain gated by the name/position allowlist only —
recognizing those needs the resolver's import-resolution machinery and
is tracked as a follow-up.
Closes #18451 parent 2de6550 commit e5fe754
6 files changed
Lines changed: 830 additions & 54 deletions
File tree
- crates/codegraph-core/src/extractors
- src/extractors
- tests
- benchmarks/resolution
- engines
- parsers
0 commit comments