You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(code-intel): calls inside Rust macro bodies (json!, vec!, format!, matches!, assert!) are not indexed; dead-code reports live functions #715
Function calls that appear inside a macro invocation are not seen as calls. In tole (8c05cd1):
tool_kind (crates/tole-cli/src/acp.rs:396) is reported by cora dead-code as "no callers found", but it is called at acp.rs:452 and acp.rs:618 inside json!({ "kind": tool_kind(tool), ... }).
approval_config_option (acp.rs:179) is reported the same way, but it is called at acp.rs:204 inside vec[approval_config_option(auto_write)].
Both of the two non-test hits I checked were false positives of this kind.
What did you expect to happen?
Tokens inside a macro invocation's delimiters are parsed as expressions where that is feasible (at least for the std macros json! from serde_json, vec!, format!, println!, assert!, assert_eq!, matches!, write!) and a call found there becomes a normal call edge. For user macros, scan the token tree for ident( and path::ident( patterns and mark those edges from-macro (lower confidence), still counted for dead-code.
tool_kind crates/tole-cli/src/acp.rs:396 — function (no callers found)
approval_config_option crates/tole-cli/src/acp.rs:179 — function (no callers found)
Activity
fix(code-intel): index calls inside Rust macro arguments so dead-code…