mantish/ help / docs
Join the waitlist

Call flow

Follow a method or a class through a change — who calls it and what it calls.

Last updated

A diff shows you a method; it does not show you how a request gets there or what happens next. Show Flow draws the path through the pull request: who calls the method — and who calls them, up to the entry points — and what it calls, down to the leaves.

Open a flow

In a C#, Java, Python, Go, Rust, JavaScript (.js) or TSX (.tsx) file, right-click a name and pick Show Flow, or put the caret on it and press ⌃⌥H. What the flow starts from depends on where you ask:

  • On a method's or a property's name — its declaration or a call to it — the flow of that member.
  • On a class's name — the flow of every member of the class.
  • Anywhere else — the member the caret is in, or the class when it is in none; on a file's own top-level code, that code.
Show Flow in the menu of a method's name
Show Flow in the menu of a method's name

In the Diagram, right-click a member of a file's box and pick Show Flow for that member's flow.

The flow opens in a tab of its own, named after what you asked about — Flow: OrderService.Place — OrderService.cs. Ask for the same flow again and its tab comes back with a fresh answer. Flow tabs last until you close them or reload the app.

When the pull request gets new commits and you refresh the review, a flow tab opened before is dimmed and its toolbar says Out of date; Refresh asks for the same flow again — finding the member, or the class, where the new commits moved it in its file — and redraws it in place, your filters and the blocks you moved kept. When the file no longer has it (renamed, removed or moved to another file), the tab says so; ask Show Flow on it where it stands now.

Read a flow

Each class is a block, listing only its members in the flow, and the blocks stand left to right in call order: callers on the left, the member you asked about in the middle, what it calls on the right. A line goes from a calling member to the member it reaches.

The call flow of OrderService.PlaceAsync
The call flow of OrderService.PlaceAsync
You seeIt means
A highlighted rowThe member you asked about (every member of a class, for a class)
A, M or D on a rowThe pull request added, changed or deleted that member
A faded rowThe pull request did not change it — it is there so the path is whole
A solid lineA call
A long-dashed green lineAn interface's or a base class's member reaching its implementation
A dotted lineA field read or written
A short-dashed lineA possible call — the receiver's type could not be worked out

A call through an interface goes on into its implementations, so a flow does not stop at dependency injection.

Code that no method holds has a place too. A file's own top-level code — a script's statements, a test file's describe and it blocks, an Express app's route registrations — is the top level row of its file's block, where the paths it starts begin. What constructing an object runs — a Java initializer block, a Kotlin init block, a Scala class body, a C# primary constructor — belongs to the constructor, so a new reaches it; a class that declares no constructor gets the one the language gives it, at the class's name. A constructor goes on into its superclass's when the language runs it without a written call — Java's implicit super(), Scala's extends Base and with Trait — and an object's or a companion's init blocks are its own init row.

  • Callers + callees, Callers and Callees pick the direction; Depth draws 1, 2 or 3 calls each way, or All.
  • The legend switches Field access and Possible calls off and on.
  • Statistics in the toolbar puts beside each member the change touched the counts the file list shows for a file — the lines added, changed and removed in that member, what moved, what is spotlighted and muted — and takes them away again, for every flow and diagram.
  • Hover a line to see where its calls are written; click it to open the first of them.
  • Click a member to open its file at that member. ⌘-click (Ctrl-click on Windows and Linux) opens it in a modal over the flow instead, and Esc brings the flow back — or swap the two in Settings › Diagram › Opening files.
  • Hold the Hover Reveal key (⌘ on macOS, Alt elsewhere — the one Inline Reveal waits for) over a member to preview it in its file — its declaration, the changes painted, the rest of the file dimmed — or over a line to preview exactly where its calls are written, the name ringed; ‹ › step through a line's calls. Let go of the key and the preview goes.
  • Drag a block to move it — its lines follow it. Drag the background to move around, scroll to pan, ⌘-scroll to zoom; Fit all fits the flow back into view.

What a flow includes

A flow follows the pull request's files only — for a local repository, the changes you are reviewing. A call into a file the pull request does not touch is not drawn, so a path can end where your change does. A very large flow is drawn up to its 300 nearest members, and a note says it goes on.

Call flow is part of the Pro plan.

Was this page helpful?