Fast Coverage

High-performance code coverage highlighting for VS Code using Istanbul JSON data (coverage-final.json).
Fast Coverage decorates covered and uncovered lines directly in the editor and shows the active file coverage percent in the status bar.
Animated Demo
The demo animation shows the status bar toggle switching from Coverage Off to an active percentage, with covered and uncovered line decorations appearing in the editor.
Features
- Highlights covered lines in green and uncovered lines in red.
- Shows per-file line coverage in the status bar.
- One-click toggle from status bar or command palette.
- Watches coverage files and refreshes decorations automatically.
- Supports multiple coverage file glob patterns.
How It Works
- Fast Coverage finds Istanbul JSON files using
fastCoverage.coverageFileGlobs.
- It merges entries from all matched coverage files.
- When enabled, it decorates visible editors based on statement hit counts.
- If coverage files change, the extension reloads data and updates decorations.
Requirements
- VS Code 1.85.0+
- A test setup that outputs Istanbul JSON coverage (for example
coverage-final.json)
Quick Start
- Generate coverage JSON in your project.
- Open your project in VS Code.
- Run
Fast Coverage: Toggle from the command palette.
- Use the status bar item labeled
Coverage to turn highlighting on or off.
Generate coverage-final.json
Use whichever test runner you already have. Common examples:
Jest
npx jest --coverage
Vitest
npx vitest run --coverage
nyc + mocha
npx nyc --reporter=json mocha
If your coverage output file path is not matched by the default glob, update the extension setting below.
Configuration
fastCoverage.coverageFileGlobs
Array of glob patterns used to discover Istanbul JSON files.
Default:
["**/coverage-final.json"]
Example with multiple monorepo packages:
[
"packages/*/coverage/coverage-final.json",
"apps/*/coverage/coverage-final.json"
]
Commands
Fast Coverage: Toggle (fastCoverage.toggle)
Status Bar
When enabled, the status bar shows:
N/A when no coverage exists for the active file
NN% when coverage exists for the active file
Color meaning:
- Green: 80%+
- Yellow: 50-79%
- Red: below 50%
Notes and Current Behavior
- Coverage is computed from statement hit counts.
- Decorations are line-based and whole-line.
- In multi-root workspaces, relative coverage paths are resolved against the first workspace folder.
- All files matching each configured glob are discovered (no hard cap).