C# Flow Visualizer is a Visual Studio Code extension that turns the currently open C# file into an interactive structure graph. It is designed to help you inspect code organization, follow control flow at a high level, and move quickly between the graph and the editor.
- Visualizes the active C# file as a graph.
- Shows structural elements such as namespaces, classes, methods, loops, if/else chains, and grouped code blocks.
- Keeps the visualization synchronized with the current editor selection.
- Lets you click graph nodes to reveal and highlight the related code in the editor.
- Refreshes automatically when the active C# file is saved.
Before using the extension, make sure the following are available:
- Visual Studio Code
1.108.1or newer. - A
.csfile open in the active editor. .NET 9(or newer) runtime or SDK available on yourPATH, because the extension launches a Roslyn-based analyzer throughdotnet.
- Open a C# source file in VS Code.
- Open the Command Palette.
- Run
C# Flow Visualizer: Open Visualizer. - Inspect the generated graph in the webview panel.
- Click a node to jump to the corresponding code, or move the cursor in the editor to update the highlighted element.
The visualization is based on the syntax structure of the active file. Depending on the file content, the graph can include:
- Namespaces
- Classes
- Methods
- Loops
- Conditional branches
- Aggregated code blocks for unsupported or less specific syntax regions
The extension reads the active C# document, sends its content to a Roslyn-based analyzer, and renders the returned structure inside a webview. The graph and editor remain connected so navigation works in both directions.
- Analysis is currently file-based and does not use the full project semantic model.
- Some syntax is intentionally grouped into generic code blocks instead of dedicated node types.
- The extension is focused on structural comprehension, not full semantic analysis or debugging.
If you want to build or modify the extension locally:
npm install
npm run build:web
npm run build:analyzer
npm run compileFor local extension development in VS Code:
- Run
npm run watchin the extension root if you want continuous TypeScript builds. - Press
F5to open an Extension Development Host. - Open a
.csfile and run the extension command.
- Node.js 24 (see
mise.toml) - .NET 9 SDK or newer, used to publish the Roslyn analyzer
git clone https://github.com/FHS-Creative-Technologies/csharpflowvizualizer.git
cd csharpflowvizualizer
npm install
npx @vscode/vsce packageThe result is csharp-flow-visualizer-<version>.vsix in the repository root. To try it out locally:
code --install-extension csharp-flow-visualizer-<version>.vsixsrc: VS Code extension sourceweb: React webview applicationroslynAnalyzer: Roslyn-based C# analyzeranalyzer-dist: published analyzer output included in packaged buildsplayground: sample files for manual testing
This project is licensed under the MIT License.
Thanks to Christine Bell for the huge effort in developing this VS Code extension.
Further development will take place under FH Salzburg, Department Creative Technologies.