οΈ 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(...)

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
ResultFlowDefaultThemeMSBuild 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:
- Looks for
*_Flows.g.csin the workspace β extracts the Mermaid constant β opens preview β - 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 β
- If a
/* ```mermaid...``` */comment already exists above the method: extracts it directly β opens preview β - 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.