Add AppHost CodeLens and gutter decoration support#15397
Merged
joperezr merged 8 commits intomicrosoft:release/13.2from Mar 19, 2026
Merged
Add AppHost CodeLens and gutter decoration support#15397joperezr merged 8 commits intomicrosoft:release/13.2from
joperezr merged 8 commits intomicrosoft:release/13.2from
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15397Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15397" |
… Code extension - Add CodeLens provider showing resource state, actions (start/stop/restart), and view logs - Add gutter decoration provider with colored status circles for resources - Add C# and JS/TS AppHost resource parsers with registry pattern - Add statementStartLine for multi-line fluent chain CodeLens positioning - Add comment-skipping logic so CodeLens appears below comments, above code - Extract shared resource state utilities and resource constants - Add enableCodeLens and enableGutterDecorations settings - Add comprehensive test coverage (parsers, CodeLens, resourceStateUtils) - Only match parent resources (Add* calls), not implicit child resources (With* calls)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds editor UX in the VS Code extension to surface Aspire AppHost pipeline steps and resource state inline (CodeLens) and in the gutter (decorations), backed by lightweight parsers for C#/JS/TS AppHost files.
Changes:
- Introduces AppHost resource parsers (C#, JS/TS) and shared resource-state constants/utilities.
- Adds CodeLens actions (debug pipeline step, resource state/actions/logs) and gutter status dots for resources.
- Updates tree provider to support reveal-by-resource and consistent state constants; adds/updates tests and localization/configuration.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| playground/TypeScriptApps/RpsArena/aspire.config.json | Adds Aspire config for the TS playground app. |
| playground/TypeScriptApps/RpsArena/apphost.ts | Enables PgAdmin for the Postgres resource in the playground apphost. |
| playground/TypeScriptApps/RpsArena/.modules/transport.ts | Adds JSON-RPC authentication using ASPIRE_REMOTE_APPHOST_TOKEN. |
| extension/src/views/AspireAppHostTreeProvider.ts | Uses shared constants; adds tree reveal support (findResourceElement, getParent). |
| extension/src/extension.ts | Registers CodeLens + gutter decoration providers and related commands/config. |
| extension/src/editor/AspireCodeLensProvider.ts | Implements CodeLens for pipeline steps and resource state/actions. |
| extension/src/editor/AspireGutterDecorationProvider.ts | Implements gutter status dot decorations for resources. |
| extension/src/editor/parsers/AppHostResourceParser.ts | Adds parser registry + document selection helpers. |
| extension/src/editor/parsers/csharpAppHostParser.ts | Regex-based C# AppHost resource/pipeline-step parsing. |
| extension/src/editor/parsers/jsTsAppHostParser.ts | Regex-based JS/TS AppHost resource/pipeline-step parsing. |
| extension/src/editor/resourceConstants.ts | Centralizes runtime state/style/type constants. |
| extension/src/editor/resourceStateUtils.ts | Adds helpers to locate matching runtime resources. |
| extension/src/loc/strings.ts | Adds CodeLens-localized strings. |
| extension/package.json | Adds commands + settings (enableCodeLens, enableGutterDecorations). |
| extension/package.nls.json | Adds localized strings for new settings/commands. |
| extension/loc/xlf/aspire-vscode.xlf | Adds XLF entries for new settings/commands. |
| extension/src/test/parsers.test.ts | Adds parser unit tests. |
| extension/src/test/resourceStateUtils.test.ts | Adds tests for resource matching helpers. |
| extension/src/test/codeLens.test.ts | Adds tests for CodeLens state label mapping. |
| extension/src/test/appHostTreeView.test.ts | Updates icon tests to use shared constants. |
…ce, Unhealthy as error - Guard --apphost flag when appHostPath is falsy in CodeLens commands - Prefer displayName over name in two-pass resource matching - Classify Unhealthy health status as error (not warning) to align with tree view
Member
|
Love this! Big Code Lens fan 😄 |
DamianEdwards
approved these changes
Mar 19, 2026
joperezr
approved these changes
Mar 19, 2026
Member
joperezr
left a comment
There was a problem hiding this comment.
Let's take this as risk is low and constrained to the extension.
adamint
added a commit
that referenced
this pull request
Mar 23, 2026
* Add CodeLens and gutter decoration support for AppHost resources * wip * remove status bar strings from branch * Add CodeLens, gutter decorations, and AppHost resource parsers for VS Code extension - Add CodeLens provider showing resource state, actions (start/stop/restart), and view logs - Add gutter decoration provider with colored status circles for resources - Add C# and JS/TS AppHost resource parsers with registry pattern - Add statementStartLine for multi-line fluent chain CodeLens positioning - Add comment-skipping logic so CodeLens appears below comments, above code - Extract shared resource state utilities and resource constants - Add enableCodeLens and enableGutterDecorations settings - Add comprehensive test coverage (parsers, CodeLens, resourceStateUtils) - Only match parent resources (Add* calls), not implicit child resources (With* calls) * Address Copilot review: conditional appHostPath, displayName preference, Unhealthy as error - Guard --apphost flag when appHostPath is falsy in CodeLens commands - Prefer displayName over name in two-pass resource matching - Classify Unhealthy health status as error (not warning) to align with tree view * bump extension version * update config json
10 tasks
joperezr
pushed a commit
that referenced
this pull request
Mar 23, 2026
) * Add right-click context menu on resource endpoint URLs (#15347) Add three context menu actions for endpoint URL tree items in the Running AppHosts tree view: - Copy URL to Clipboard - Open in External Browser - Open in Simple Browser Introduces EndpointUrlItem TreeItem subclass with contextValue 'endpointUrl' to enable context menu targeting, replacing the generic DetailItem for endpoint URLs. Fixes #15345 Co-authored-by: Mitch Denny <mitch@mitchdeny.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Clean up Aspire panel: context menus, loading state, welcome messages (#15375) * Clean up Aspire panel: context menus, loading state, welcome messages Adds initial 'loading' screen, new context menus for resources, endpoints, apphost, and PID nodes. Consolidates previous 3 commits into one for clean rebase onto main. * remove unused strings * remove comands on resources node, update string * Add AppHost CodeLens and gutter decoration support (#15397) * Add CodeLens and gutter decoration support for AppHost resources * wip * remove status bar strings from branch * Add CodeLens, gutter decorations, and AppHost resource parsers for VS Code extension - Add CodeLens provider showing resource state, actions (start/stop/restart), and view logs - Add gutter decoration provider with colored status circles for resources - Add C# and JS/TS AppHost resource parsers with registry pattern - Add statementStartLine for multi-line fluent chain CodeLens positioning - Add comment-skipping logic so CodeLens appears below comments, above code - Extract shared resource state utilities and resource constants - Add enableCodeLens and enableGutterDecorations settings - Add comprehensive test coverage (parsers, CodeLens, resourceStateUtils) - Only match parent resources (Add* calls), not implicit child resources (With* calls) * Address Copilot review: conditional appHostPath, displayName preference, Unhealthy as error - Guard --apphost flag when appHostPath is falsy in CodeLens commands - Prefer displayName over name in two-pass resource matching - Classify Unhealthy health status as error (not warning) to align with tree view * bump extension version * update config json * Fix dashboard image in marketplace README and bump version to 1.0.6 (#15379) * Fix dashboard image URL: dotnet -> microsoft (#15466 partial) --------- Co-authored-by: Mitch Denny <midenn@microsoft.com> Co-authored-by: Mitch Denny <mitch@mitchdeny.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
Add CodeLens and gutter decoration support for AppHost resource files in the VS Code extension. When an Aspire AppHost is running, resources defined in C# and JS/TS AppHost files now show inline status indicators and action buttons directly in the editor.
What's included
CodeLens Provider — Inline lenses above each resource showing:
Gutter Decoration Provider — Colored status circles in the editor gutter:
aspire.enableGutterDecorationssettingAppHost Resource Parsers — Extensible parser registry for detecting resources:
DistributedApplication.CreateBuilder/#:sdk Aspire.AppHost.Sdk, extracts.Add*("name")calls@aspireimports /createBuilder(), extracts.add*("name")callsstatementStartLinecomputation for multi-line fluent chains (CodeLens appears at top of chain, below comments)Shared Utilities:
resourceConstants.ts— Centralized resource state, style, type, and health status constantsresourceStateUtils.ts— Resource state matching across AppHosts and workspace resourcesSettings:
aspire.enableCodeLens(default: true)aspire.enableGutterDecorations(default: true)Tests
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: