Skip to content

feat(lsp): add test coverage support - #36314

Open
bookenjoyer67 wants to merge 1 commit into
denoland:mainfrom
bookenjoyer67:feat/lsp-test-coverage
Open

feat(lsp): add test coverage support#36314
bookenjoyer67 wants to merge 1 commit into
denoland:mainfrom
bookenjoyer67:feat/lsp-test-coverage

Conversation

@bookenjoyer67

@bookenjoyer67 bookenjoyer67 commented Jul 25, 2026

Copy link
Copy Markdown

Implements test coverage visualization for the LSP testing API (closes #18147).

When the test run kind is 'coverage', the LSP passes --coverage=<temp_dir> to deno test, collects the V8 coverage JSON files after execution, and sends a new deno/testCoverage notification to the client.

The notification payload includes:

  • File URIs with their coverage data
  • Arrays of covered and uncovered line numbers (1-indexed)
  • Coverage percentage per file

The implementation parses the V8 ScriptCoverage format, converts character offsets to line numbers, and filters out external dependencies (only files under the workspace are reported).

Changes:

  • cli/lsp/testing/lsp_custom.rs — New types: FileCoverage, CoverageNotificationParams, CoverageNotification
  • cli/lsp/testing/execution.rscollect_coverage_from_dir() reads and parses V8 JSON files, coverage_dir() method, --coverage flag integration
  • cli/lsp/client.rsCoverage variant on TestingNotification + send handler

Companion PR: denoland/vscode_deno#1389

Implements test coverage visualization for the LSP testing API.

When the test run kind is 'coverage', the LSP passes --coverage=<temp_dir>
to 'deno test', collects the V8 coverage JSON files after execution, and
sends a new 'deno/testCoverage' notification to the client.

The notification payload includes file URIs with covered/uncovered line
numbers (1-indexed) and coverage percentage per file.

Closes denoland#18147
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.

feat: view test coverage in editor

1 participant