Feature Enhancement: per-file coverage in Explorer, C/C++ Support & visualize branch/region execution#498
Feature Enhancement: per-file coverage in Explorer, C/C++ Support & visualize branch/region execution#498mr-u0b0dy wants to merge 11 commits intoryanluker:masterfrom
Conversation
…providers Features: - Add LLVM-cov JSON parser for C++ coverage with region-wise execution counts - Add branch coverage CodeLens and Hover providers for partial coverage visualization - Add C example project with Cobertura XML (gcc + gcovr toolchain) - Add C++ example project with LLVM JSON (clang + llvm-cov toolchain) Infrastructure: - Migrate esbuild.js to esbuild.mjs for ES module support - Fix test package.json generation to ensure CommonJS output - Add llvm-cov.json to default coverage file names - Increase test timeout to 10s for headless xvfb runs - Add comprehensive unit tests for branch coverage providers - Add integration tests for C and C++ example projects Documentation: - Update README with C/C++ support highlights - Add detailed C and C++ example READMEs with toolchain setup
- Add RegionHighlighter to emphasize the active LLVM region on hover - Hover now displays only the closest region’s execution count - Cobertura: show per-line condition coverage (%, edges covered/total) and per-condition details - Switch complex regex to RegExp constructor to fix tsc invalid character errors Build: type-check and bundle pass; lint/format applied
…Java, PHP, Python, and Ruby
- Add CoverageFileDecorationProvider to display per-file coverage % - Implement showExplorerCoverage config toggle (default: true) - Color-code badges: green ≥80%, yellow ≥50%, red <50% - Support absolute/relative paths and remote path mapping - Integrate with coverage service update notifications - Register provider for proper disposal and lifecycle management
- Extract per-line branch hit counts from Cobertura XML and use real counts instead of 0/1 - Fix branch merging to accumulate hit counts instead of incrementing by 1 - Add LLVM JSON support to use actual execution counts for true/false branches - Add gcovr JSON fallback parser for per-branch coverage with accurate hit counts - Store branch hit counts in section metadata for accurate hover display - Generate C example coverage artifacts: Cobertura XML, LCOV, and gcovr JSON Fixes hover display to show accurate per-branch execution counts instead of generic coverage summaries. Enables comprehensive branch coverage visualization across multiple coverage formats (Cobertura, LLVM JSON, gcovr JSON, LCOV).
- Add comprehensive Rust example project with calculator library - Include sample LLVM JSON coverage report - Add detailed README with instructions for cargo-tarpaulin and cargo-llvm-cov - Update main README to list Rust as officially supported language - Add 'rust' keyword to package.json for better discoverability - Configure VS Code settings for Rust coverage files The extension already supports LLVM JSON format, so Rust works out of the box with tools like cargo-tarpaulin and cargo-llvm-cov.
|
@mr-u0b0dy Massive props for the impactful PR across many open issues! At first glance, it might be better to split up the PR into 3 parts so that way it will be easier to review and understand the changes you want to make. Thoughts? In the meantime, I have approved your PR / Branch to use the CI runner so we can start working through any test failures. |
|
I’ve made separate commits for each feature addition, and I hope this makes the review easier. Since these are incremental commits—where upcoming changes depend on files introduced in the first commit—it might be better to include them in a single PR. I’ll proceed with fixing the test failures, and I’m also looking forward to the addition of the line hit count feature (#491). |
…nt environments The python integration test was failing because coverage XML contained relative file paths but <source> entries specifying the project root. When tests ran in environments with different workspace roots (CI/Windows), the SectionFinder couldn't match coverage to the open file. Changes: - Extract <source> roots from Cobertura XML - Expand relative file paths by joining with each <source> root to create absolute variants - Keep original relative paths for backward compatibility with local environments - Remove realpath parameter from parseContentCobertura to preserve relative paths during parsing This ensures coverage matching works across different environment configurations. Fixes: ryanluker#166 - 'Run display coverage on python test file @integration' failure
Alright no worries on the mega PR this time, there might be some process improvements we can do in the future around leveraging stacked PRs for big code additions like this 🤔. |
|
Makes sense — stacked PRs sound like a good fit for changes like this. I’ll take a look at git-spice and keep that in mind for future work. Thanks! |
Review progress wise, I should be able to finish up the review this upcoming weekend. |
Features
showExplorerCoverage.Issues