MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / handlerSite

Function handlerSite

src/resolution/frameworks/rust.ts:104–107  ·  view source on GitHub ↗
(exprEnd: number, expr: string, handler: string)

Source from the content-addressed store, hash-verified

102 // ending at `exprEnd`: the Rust scope gate reads the reference's line, and
103 // rustfmt wraps a long `.route(` call so its handler sits below it (#2326).
104 const handlerSite = (exprEnd: number, expr: string, handler: string) => {
105 const offset = exprEnd - expr.length + expr.lastIndexOf(handler);
106 return { line: lineAt(safe, offset), column: offset - safe.lastIndexOf('\n', offset - 1) - 1 };
107 };
108
109 // Actix-web / Rocket attribute: #[get("/path")] fn handler(..)
110 // Capture the method, path, and the fn identifier that follows.

Callers 2

extractFunction · 0.85
pushActixRouteFunction · 0.85

Calls 1

lineAtFunction · 0.90

Tested by

no test coverage detected