Skip to content

feat: show coverage indicators in minimap#307250

Merged
connor4312 merged 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/coverage-minimap-indicators
Apr 2, 2026
Merged

feat: show coverage indicators in minimap#307250
connor4312 merged 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/coverage-minimap-indicators

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature (implements a requested enhancement)

What is the current behavior?

When test coverage is displayed in the editor, coverage indicators (covered/uncovered lines) are shown in the line number gutter and optionally inline, but there is no coverage visualization in the minimap. Users who want to quickly scan for coverage gaps in a file must scroll through the entire document.

Closes #258961

What is the new behavior?

Coverage indicators now appear in the minimap gutter, showing covered regions in green and uncovered regions in red. This allows users to see coverage gaps at a glance without scrolling.

Changes:

  • New color tokens: testing.coveredMinimapBackground and testing.uncoveredMinimapBackground registered in theme.ts, with defaults matching the existing gutter coverage colors (green for covered, red for uncovered)
  • New setting: testing.coverageMinimapEnabled (boolean, default true) in configuration.ts to let users toggle minimap coverage indicators independently
  • Minimap decorations: Both statement and branch coverage decorations in codeCoverageDecorations.ts now include minimap: { color, position: MinimapPosition.Gutter } when the setting is enabled. The observable config value is read reactively so toggling the setting updates the minimap immediately.

Additional context

The implementation follows the same pattern used by the SCM quick diff decorator (quickDiffDecorator.ts), which adds minimap indicators for added/modified/deleted lines using themeColorFromId() and MinimapPosition.Gutter.

Add minimap decorations to test coverage display so users can see
covered and uncovered regions at a glance in the minimap gutter.

- Register new color tokens testing.coveredMinimapBackground and
  testing.uncoveredMinimapBackground with defaults matching the
  existing gutter coverage colors
- Add testing.coverageMinimapEnabled setting (default: true) to
  control minimap coverage visibility
- Apply MinimapPosition.Gutter decorations to both statement and
  branch coverage detail ranges, using covered/uncovered colors
  based on hit count

Closes microsoft#258961
@connor4312
Copy link
Copy Markdown
Member

nice!

image

@connor4312 connor4312 enabled auto-merge (squash) April 2, 2026 21:46
@connor4312 connor4312 merged commit e9c46ed into microsoft:main Apr 2, 2026
19 checks passed
@vs-code-engineering vs-code-engineering bot added this to the 1.115.0 milestone Apr 2, 2026
@niemyjski
Copy link
Copy Markdown

Awesome job! Any chance this screenshot could be added to the 1.115 release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show coverage indicators in minimap

4 participants