Skip to content

VS Code extension: Improve gutter, code lens, and tree view resource state indicators#15688

Open
adamint wants to merge 3 commits intomicrosoft:mainfrom
adamint:dev/adamint/gutter-codelens-improvements
Open

VS Code extension: Improve gutter, code lens, and tree view resource state indicators#15688
adamint wants to merge 3 commits intomicrosoft:mainfrom
adamint:dev/adamint/gutter-codelens-improvements

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented Mar 29, 2026

Description

Improves the VS Code extension's resource state indicators in the gutter, code lens, and tree view to provide clearer, more informative feedback about resource status.

Changes

Gutter & Code Lens

  • Distinct gutter icons: Replaced colored circle dots with distinct SVG shapes (✓ checkmark, ⚠ triangle, ✕ X mark, ⌛ hourglass, ○ hollow circle) to avoid confusion with breakpoints (VS Code Gutter + Codelens icon feedback #15577)
  • NotStarted vs Waiting distinction: NotStarted resources no longer show a loading spinner — only Waiting resources spin (in aspire panel, limit loading state for not started resources to resources actually waiting #15667)
  • Unhealthy = warning (yellow): Resources with Unhealthy health status now show yellow warning indicators instead of red error
  • Health check details in code lens: Shows health check counts (e.g. "Running - (Unhealthy 0/1)") with per-check tooltip
  • Exit code display: Stopped resources show exit code in code lens; non-zero exit codes display as errors in both gutter and tree view
  • Completed resources: Successfully finished resources (exit code 0) get a distinct pale green checkmark in gutter
  • Stopped state handling: Added explicit handling of Stopped state (previously fell through to defaults) in gutter, code lens, and tree icon
  • Consistent Stopping state: Stopping now shows a spinner/starting indicator consistently across gutter (hourglass), tree view (spinner), and code lens (Starting label)

Tree View Panel

  • Health check child nodes: Resources with health checks show an expandable "Health Checks" group with per-check status (pass/warning/error icons)
  • Rich resource descriptions: Tree item descriptions show resource type + state + health check counts + exit code (e.g. "Project · Running · Health: 1/2 · Exit Code: 137")
  • Detailed resource tooltips: Hover tooltip shows per-check status with icons and descriptions
  • Expand all button: Inline expand-all button on apphost/workspace items to quickly reveal all resources (collapse-all uses the built-in VS Code tree collapse)
  • Better icon mapping: Unhealthy → warning icon, NotStarted → record (no spinner), successful exit → green pass, non-zero exit → error

Localization

  • All new user-facing strings are properly localized via vscode.l10n.t() in strings.ts
  • Health and exit code descriptions in tree view use localized string wrappers

Walkthrough

  • Added "Editor indicators" section describing gutter icons and code lens with a screenshot

Fixes #15667
Fixes #15577

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Copilot AI review requested due to automatic review settings March 29, 2026 01:26
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 29, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15688

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15688"

@adamint
Copy link
Copy Markdown
Member Author

adamint commented Mar 29, 2026

@afscrome

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Aspire VS Code extension’s editor and tree view resource-state visuals to be more distinguishable and informative (especially around unhealthy/waiting/not-started and exit-code scenarios), and documents the new editor indicators in the walkthrough.

Changes:

  • Replaces gutter dot decorations with distinct SVG icon shapes (plus a “completed” variant) and refines state classification (e.g., Waiting spins; NotStarted does not).
  • Enhances code lens state labeling with Waiting/Not Started labels, exit code display, and health check count/tooltip details.
  • Improves tree view icons/tooltips to better reflect unhealthy/exit-code states and show per-check health report details; updates walkthrough documentation.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
extension/walkthrough/runApp.md Adds “Editor indicators” documentation and screenshot reference.
extension/src/views/AspireAppHostTreeProvider.ts Updates tree icons for unhealthy/exit-code states and expands tooltip with health report details.
extension/src/views/AppHostDataRepository.ts Extends ResourceJson with healthReports and exitCode fields.
extension/src/editor/AspireGutterDecorationProvider.ts Replaces colored dot gutter icons with distinct SVG shapes and adds “completed” category.
extension/src/editor/AspireCodeLensProvider.ts Adds Waiting/Not Started labels, exit-code aware stopped labels, and health report counts/details in code lens.
extension/src/loc/strings.ts Adds localized strings for new code lens labels (waiting/not-started/exit-code variants).
extension/src/test/codeLens.test.ts Updates and extends tests for new state labels and exit-code behavior.
extension/src/test/appHostTreeView.test.ts Updates and extends tests for new tree icon behavior and spinner distinctions.

@adamint adamint force-pushed the dev/adamint/gutter-codelens-improvements branch 3 times, most recently from d3b82a6 to 7c0a86b Compare March 29, 2026 02:20
…state indicators

- NotStarted resources show grey idle icon instead of loading spinner
- Waiting resources show 'Waiting' label distinct from 'Starting'
- Unhealthy health status shows yellow/warning instead of red/error
- Successfully completed resources show pale green gutter dot and green tree icon
- Non-zero exit codes show as error in gutter and tree view
- Exit codes displayed in code lens for stopped resources
- Health check details shown in code lens (e.g. 'Unhealthy 1/3') and tree tooltip
- Added healthReports and exitCode to ResourceJson TypeScript interface
- Added walkthrough section explaining editor indicators

Fixes microsoft#15667
Related to microsoft#15577
@adamint adamint force-pushed the dev/adamint/gutter-codelens-improvements branch from 7c0a86b to f7faa2f Compare March 29, 2026 02:36
adamint and others added 2 commits March 28, 2026 19:47
- Localize hardcoded 'Health:' and 'Exit Code:' strings in
  buildResourceDescription via vscode.l10n.t() wrappers
- Make Stopping state consistent: show spinner/Starting label in code
  lens (matches gutter hourglass and tree view spinner)
- Fix healthCheckDescription from no-op '{0}' to 'Status: {0}'
- Fix weak test assertion: assert 'Exit Code: 1' instead of just '1'
- Fix fragile raw-newline tooltip markdown to use explicit \n\n

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Check stateStyle Error before Unhealthy in getResourceIcon to match
  gutter classifyState ordering (error takes precedence over warning)
- Use HealthStatus constants instead of hardcoded strings in tooltip
- Sort health report entries by name for stable tooltip ordering

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidfowl
Copy link
Copy Markdown
Contributor

screenshot?

@adamint
Copy link
Copy Markdown
Member Author

adamint commented Mar 29, 2026

screenshot?

delta wifi blocks uploading screenshots to github, for some reason

@github-actions
Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

case ResourceState.NotStarted:
return codeLensResourceStarting;
return codeLensResourceNotStarted;
case ResourceState.FailedToStart:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Stopping reuses codeLensResourceStarting, which renders as "$(loading~spin) Starting". When a resource is actively stopping, users will see "Starting" — the opposite of what's happening. The spinner icon is appropriate, but the text should say "Stopping". Consider adding a codeLensResourceStopping string (e.g., $(loading~spin) Stopping).

The test at line 95 ('Stopping returns starting label') asserts this incorrect behavior too.

this.contextValue = 'healthChecksGroup';
const reports = resource.healthReports;
if (reports) {
const total = Object.keys(reports).length;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This defaults to Expanded, which means every resource with health checks will always show the full health check list in the tree. For an app with many resources each having multiple health checks, this significantly inflates the tree on every refresh.

Consider using Collapsed here — the parent ResourceItem description already includes the health summary (e.g., "Health: 1/2"), so users get the key info at a glance and can expand for details when needed.

const reports = resource.healthReports;
const exitCode = resource.exitCode;
if (reports && Object.keys(reports).length > 0) {
const total = Object.keys(reports).length;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This shows exit code unconditionally when non-null, including exit code 0. A successful exit produces "Project · Finished · Exit Code: 0" in the tree description and "Stopped (Exit Code: 0)" in the code lens. Exit code 0 is the normal/expected case — surfacing it the same way as non-zero codes adds visual noise without much value. Consider only showing exit code when exitCode !== 0.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

in aspire panel, limit loading state for not started resources to resources actually waiting VS Code Gutter + Codelens icon feedback

4 participants