class

Analyzer::Rust::Tide

Inherits Analyzer::Rust::RustEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Tide analyzer (tree-sitter port). Tide registers routes in two shapes, both handled here:

  1. Direct chain: app.at("/users/:id").get(get_user);

  2. Variable + method: let health_route = app.at("/health"); health_route.get(health_check);

We collect both let <var> = <expr>.at("/path") bindings and direct .at("/path").<verb>(handler) chains in a single AST pass.

Constants

MAX_COMPOSED_VAR_PATH_BYTES = 2048

Walk let <var> = … bindings and record var → path for bindings whose RHS is a .at("path") call somewhere. We use the outermost .at we find on the RHS, mirroring the legacy (\w+)\s*=\s*\w+\.at(...) regex. Every route variable stores its fully composed path, so a long let aN = aN-1.at("/s") chain would hold O(n²) bytes. Past this length a variable keeps just its own .at literal instead.

STATIC_VERBS = Set {"serve_dir", "serve_file"}

serve_dir / serve_file are static-mount terminals that respond to GET, registered the same app.at("/p").serve_dir("dir") way.

Class methods

tech_name
Source

Instance methods

analyze_file(path : String) : Array(Endpoint)
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source