fix: branch coverage parsing, UI consistency, and sidebar accuracy#4
Closed
fix: branch coverage parsing, UI consistency, and sidebar accuracy#4
Conversation
- Parse arc table for branch-coverage .coverage files (coverage.py branch=true); previously all files showed 0% because line_bits is empty in that mode - Fix inferMissingLines to track bracket depth, eliminating false red highlights on continuation lines inside __all__, multi-line function calls, dict literals - Run pytest via child_process.spawn instead of a VS Code terminal; eliminates ^C corruption from the Python extension auto-activating the venv in terminals - Debounce file-watcher reloads and guard handleNoCoverage with a mutex to prevent concurrent prompts on rapid file changes - Filter test files from Coverage tree and dashboard (excludeTestFiles setting) - Recompute filtered totals in tree Overall, status bar, and dashboard ring so all three surfaces always show the same percentage - Remove info-message toast on every reload; status bar is sufficient - Dashboard header icon inlined as SVG so currentColor inherits VS Code theme - Panel tab icon uses ThemeIcon graph — works on light and dark themes - Coverage tree moved back to Explorer panel for discoverability - Add activity bar SVG icon and dashboard icon assets
…version supersedes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problems fixed
1. 0% coverage everywhere with
branch=trueprojectscoverage.py's
branch=truemode writes only to thearctable — theline_bitstable is empty. The extension was only readingline_bits, so all files showed 0%. Now detects arc mode and reads(fromno, tono)pairs; positive values = executed lines, negative values = virtual entry/exit markers (ignored).2. False red highlights on continuation lines
Multi-line constructs like
__all__ = [...], multi-line function calls, and dict literals had each continuation line marked as uncovered.inferMissingLinesnow tracks bracket depth — lines inside an unclosed([{are skipped as they are not independent statements.3. ^C corruption when running pytest
VS Code's Python extension injects
source /path/activateinto any new terminal ~500ms after creation, corrupting running processes. Replaced terminal-based pytest run withchild_process.spawn— background processes are unaffected by the Python extension's venv auto-activation.4. Percentage mismatch across surfaces
Status bar showed raw totals (all files), tree "Overall" showed raw totals, dashboard showed filtered totals — three different numbers. All three now compute filtered stats identically (respecting
excludeTestFiles).5. Coverage tree disappeared
Moving the tree to a custom activity bar container made it undetectable. Moved back to the Explorer panel where users naturally look.
6. Dashboard tab icon invisible on dark themes
Panel tab now uses
ThemeIcon('graph')which VS Code themes automatically. Dashboard header icon is inlined SVG socurrentColorinherits the editor foreground on both light and dark themes.7. Noisy info popup on every reload
Removed the
showInformationMessagetoast that fired on every load and auto-reload. The status bar shows the same information persistently.What changed
src/parsers/coverageParser.ts— arc table detection + bracket-depth tracking ininferMissingLinessrc/extension.ts— spawn-based pytest runner, debounced watchers, filtered status bar stats, no popupsrc/providers/treeProvider.ts— filtered totals for Overall summary, test-file filter on file listsrc/ui/dashboardPanel.ts— ThemeIcon for tab, inline SVG for header, filtered ring/totalssrc/ui/statusBar.ts— accepts pre-computed filtered stats instead of raw reportsrc/config.ts—excludeTestFilessetting wired uppackage.json— tree view moved back to Explorer,excludeTestFilesconfig entry addedassets/— activity bar SVG icon added