Development
This guide covers everything you need to build, debug, and contribute to the LiveDoc VS Code extension locally.
Prerequisites
| Tool | Version | Purpose |
|---|---|---|
| Node.js | 18+ | JavaScript runtime |
| pnpm | 9+ | Package manager (monorepo) |
| VS Code | Latest | Extension host and debugger |
Getting Started
1. Clone and Install
git clone https://github.com/dotnetprofessional/LiveDoc.git
cd LiveDoc
pnpm install
2. Build the Extension
cd packages/vscode
pnpm run compile
3. Launch in VS Code
Option A: Extension Development Host (recommended)
- Open the
packages/vscodefolder in VS Code - Press F5 to launch the Extension Development Host
- A new VS Code window opens with the extension loaded and ready to test
Option B: Watch Mode
Start the TypeScript watcher for continuous compilation, then launch:
pnpm run watch
Press F5 in VS Code to launch the Extension Development Host. Changes
recompile automatically — press Ctrl+R (Cmd+R on Mac) in the host window
to reload the extension.
Project Structure
packages/vscode/
├── src/
│ ├── extension.ts # Extension entry point (activate/deactivate)
│ ├── ExecutionResultOutline/ # Test results tree view provider
│ ├── reporter/ # WebView reporter components
│ └── tableFormatter/ # Data table formatting logic
├── snippets/
│ └── livedoc.json # Code snippet definitions
├── images/ # Icons and images
├── .vscode/
│ ├── launch.json # Debug configurations
│ └── tasks.json # Build tasks
├── package.json # Extension manifest & contribution points
└── tsconfig.json # TypeScript configuration
Key Files
| File / Directory | Purpose |
|---|---|
src/extension.ts | Registers commands, tree views, and activates the extension |
src/tableFormatter/ | Implements the LiveDoc: Format Data Tables command |
src/reporter/ | WebView panel for the embedded viewer |
src/ExecutionResultOutline/ | Activity bar tree view showing test results |
snippets/livedoc.json | All ld-* snippet definitions |
package.json | Extension manifest — commands, snippets, activation events |
Debugging
- Set breakpoints in your TypeScript source files
- Press F5 to start the debugger
- The Extension Development Host launches as a separate VS Code window
- Trigger extension features (snippets, commands) to hit your breakpoints
- Use the Debug Console in the primary window to inspect variables
After making changes, press Ctrl+R (Cmd+R on Mac) in the Extension
Development Host to reload the extension without restarting the full debug
session.
Running Tests
cd packages/vscode
pnpm test
Tests run inside the VS Code test runner, which launches a headless Extension Development Host.
Packaging for Distribution
Create a .vsix package for manual installation or marketplace publishing:
cd packages/vscode
pnpm run package
This generates a livedoc-{version}.vsix file. Install it locally with:
code --install-extension livedoc-{version}.vsix
Or publish to the VS Code Marketplace using the vsce CLI tool.
Development Workflow Summary
Key Takeaways
- Build with
pnpm run compile, watch withpnpm run watch - Debug by pressing F5 — sets up the Extension Development Host automatically
- Reload with
Ctrl+Rin the host window for fast iteration - Package with
pnpm run packageto create a distributable.vsix
See Also
- VS Code Extension Overview — features and installation
- VS Code Extension API — official VS Code extension docs
- Vitest SDK — the testing framework this extension supports