Skip to main content

handle_trace_data

Function handle_trace_data 

Source
pub fn handle_trace_data(req: &RawRequest, ctx: &AppContext) -> Response
Expand description

Handle a trace_data request.

Traces how an expression flows through variable assignments within a function body and across function boundaries via argument-to-parameter matching. Destructuring, spread, and unresolved calls produce approximate hops and stop tracking.

Expects:

  • file (string, required) — path to the source file containing the symbol
  • symbol (string, required) — name of the function containing the expression
  • expression (string, required) — the expression/variable name to track
  • depth (number, optional, default 5) — maximum cross-file hop depth

Returns TraceDataResult with fields: expression, origin_file, origin_symbol, hops (array of DataFlowHop), depth_limited.

Returns error if:

  • required params missing
  • call graph not initialized (configure not called)
  • symbol not found in the file