️ CodeLens β€” Diagram Preview (v1.48.0)

Install REslava.Result Extensions from the VS Code Marketplace to get a β–Ά Open diagram preview CodeLens above every [ResultFlow]-annotated method β€” always visible, no cursor needed.

[ResultFlow(MaxDepth = 2)]
β–Ά Open diagram preview          ← click to open a dedicated diagram panel
public Result<Order> PlaceOrder(...)

CodeLens, diagram panel and toolbar in action

Upgraded to WebviewPanel renderer in v1.49.0 β€” bundled Mermaid v10.9.5, fully offline, no external dependencies.

Panel features (v1.49.0 / VSIX v1.1.0):

  • Node-click navigation β€” click any diagram node to jump to that exact line in your source (requires ResultFlowLinkMode=vscode β€” see Β§3.9)
  • Source button β€” view and copy the raw Mermaid DSL
  • Legend button β€” node colour guide and interaction hints
  • SVG / PNG buttons β€” export the diagram to disk; PNG at 2Γ— resolution for high-DPI screens
  • Light and dark background follows your ResultFlowDefaultTheme MSBuild property

To enable node-click navigation, add to your .csproj or Directory.Build.props:

<PropertyGroup>
  <ResultFlowLinkMode>vscode</ResultFlowLinkMode>
</PropertyGroup>

How it works β€” 4-step fallback chain:

  1. Looks for *_Flows.g.cs in the workspace β†’ extracts the Mermaid constant β†’ opens preview βœ…
  2. If the project hasn't been built yet: automatically runs the Insert diagram as comment code action (Roslyn must be warm) β†’ extracts diagram from the inserted comment β†’ opens preview βœ…
  3. If a /* ```mermaid...``` */ comment already exists above the method: extracts it directly β†’ opens preview βœ…
  4. Otherwise: shows an information message β€” "Diagram not ready yet β€” try again in a moment"

The VSIX is a separate install from the NuGet packages β€” install both independently: - NuGet: dotnet add package REslava.Result.Flow - VS Code Marketplace: REslava.Result Extensions

The VSIX does not ship inside the NuGet package. Ctrl+. lightbulb keeps the existing Insert / Refresh diagram actions (REF002) unchanged.