Navigate code documentation graphs extracted from @flowdoc-* comment tags.
- ๐ Parse
@flowdoc-*tags from PHP, TypeScript, JavaScript files - ๐ Build navigable graphs per topic
- ๐งญ Step-by-step navigation with branching support
โ ๏ธ Warnings for duplicates, missing dependencies, cycles
// @flowdoc-topic: user-registration
// @flowdoc-id: REG-001
// @flowdoc-step: User submits registration form
// @flowdoc-topic: user-registration
// @flowdoc-id: REG-002
// @flowdoc-step: Validate email and password
// @flowdoc-dependency: REG-001
// @flowdoc-topic: user-registration
// @flowdoc-id: REG-003
// @flowdoc-step: Create user in database
// @flowdoc-dependency: REG-002 [After validation passes]
// @flowdoc-links: file:app/Models/User.php:45; symbol:App\\Models\\User@create- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Run
FlowDoc: Pick Topic - Select a topic
- Use Prev/Next buttons to navigate the graph
- Node.js 18+
- VS Code 1.85+
cd flowdoc
npm install
npm run compile- Open the
flowdocfolder in VS Code - Press
F5(or Run โ Start Debugging) - A new VS Code window opens (Extension Development Host)
- Open a folder with
@flowdoc-*comments - Run
FlowDoc: Pick Topicfrom Command Palette
npm run watchChanges auto-compile. Reload Extension Host with Cmd+R / Ctrl+R.
Create flowdoc.config.yaml in workspace root:
version: 1
repos:
other-repo:
path: /path/to/other/repoFlowDoc supports bidirectional navigation between repositories:
Backward navigation (child โ parent): Use @flowdoc-dependency with repo-name@node-id:
// In frontend-app repo
// @flowdoc-topic: authentication
// @flowdoc-id: login-handler
// @flowdoc-step: Handle login form submission
// @flowdoc-dependency: backend-api@auth-endpointForward navigation (parent โ children): Use @flowdoc-children with comma-separated IDs:
// In backend-api repo
// @flowdoc-topic: authentication
// @flowdoc-id: auth-endpoint
// @flowdoc-step: Backend auth endpoint
// @flowdoc-children: frontend-app@login-handler, mobile-app@auth-screenCross-repo navigation opens the target repository in a new VS Code window.
| Tag | Required | Description |
|---|---|---|
@flowdoc-topic |
โ | Topic name (groups nodes) |
@flowdoc-id |
โ | Unique identifier |
@flowdoc-step |
โ | Step description |
@flowdoc-dependency |
โ | Parent node ID [optional note] |
@flowdoc-children |
โ | Comma-separated child IDs (for forward nav) |
@flowdoc-links |
โ | Semicolon-separated links |
Use @flowdoc-line for compact single-line documentation:
@flowdoc-line: TOPIC | ID | STEP | links | dependency | children
| Position | Field | Required | Description |
|---|---|---|---|
| 1 | TOPIC | โ | Topic name |
| 2 | ID | โ | Unique identifier |
| 3 | STEP | โ | Step description |
| 4 | links | โ | Semicolon-separated links |
| 5 | dependency | โ | Parent node ID [optional note] |
| 6 | children | โ | Comma-separated child IDs |
Examples:
// Minimal (required fields only)
// @flowdoc-line: checkout | CART-001 | User adds item to cart
// With dependency
// @flowdoc-line: checkout | CART-002 | Cart totals calculated | | CART-001
// Full format
// @flowdoc-line: checkout | CART-003 | Proceed to payment | file:checkout.ts:50 | CART-002 [After validation] | CART-004FlowDoc automatically detects numeric sequences in IDs and creates bidirectional links:
// No explicit dependencies needed - FlowDoc auto-links these!
// @flowdoc-topic: onboarding
// @flowdoc-id: STEP-001
// @flowdoc-step: Welcome screen
// @flowdoc-topic: onboarding
// @flowdoc-id: STEP-2 // Auto-linked to STEP-001
// @flowdoc-step: Profile setup
// @flowdoc-topic: onboarding
// @flowdoc-id: STEP-03 // Auto-linked to STEP-2
// @flowdoc-step: PreferencesHow it works:
- Detects numeric suffix in IDs (e.g.,
STEP-001,TASK-2,FLOW-03) - Handles mixed formats:
001links to2links to03 - Auto-assigns dependency to
{prefix}{n-1}if it exists - Auto-assigns children to
{prefix}{n+1}if it exists - Only applies within the same topic
- Explicit dependencies/children override auto-detection
| Format | Example | Action |
|---|---|---|
symbol: |
symbol:App\\Class@method |
Opens Quick Open with symbol search |
file: |
file:path/to/file.ts:42 |
Opens file at line |
url: |
url:https://docs.example.com |
Opens in browser |
FlowDoc shows validation errors as VS Code diagnostics (yellow underlines) directly in your code for missing required fields:
- missing-topic: Block has
@flowdoc-idbut no@flowdoc-topic - missing-id: Block has
@flowdoc-topicbut no@flowdoc-id - missing-step: Block has topic and id but no
@flowdoc-step
These appear in the Problems panel and as squiggly underlines in the editor.
FlowDoc shows non-blocking warnings in the webview panel for:
- Duplicate ID: Same ID used twice in a topic (first occurrence wins)
- Missing Dependency: Dependency ID not found (node treated as root)
- Cycle Detected: Circular dependency chain
| Command | Description |
|---|---|
FlowDoc: Pick Topic |
Select topic and open graph |
FlowDoc: Open Graph |
Reopen last viewed graph |
FlowDoc: Reindex Workspace |
Force full re-scan |
.php.ts.js
Files in node_modules are excluded.
src/
โโโ extension.ts # Entry point, command registration
โโโ types/
โ โโโ index.ts # TypeScript interfaces
โโโ parser/
โ โโโ commentParser.ts # Line-based @flowdoc-* parser
โโโ indexer/
โ โโโ workspaceIndexer.ts # FileSystemWatcher + caching
โโโ graph/
โ โโโ graphBuilder.ts # DAG construction with cycle detection
โโโ config/
โ โโโ configLoader.ts # YAML/JSON config loader
โโโ webview/
โโโ webviewProvider.ts # Webview panel management
media/
โโโ styles.css # VSCode theme-aware styles
โโโ main.js # Webview UI logic
MIT