Skip to content

Forward port VS Code extension changes from release/13.2 to main - #15502

Merged
Jose Perez Rodriguez (joperezr) merged 5 commits into
mainfrom
forward-port/extension-13.2-to-main
Mar 23, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 5 commits into
mainfrom
forward-port/extension-13.2-to-main

Conversation

@adamint

Copy link
Copy Markdown
Member

Description

Forward port VS Code extension changes from release/13.2 to main. These 5 extension-scoped commits were made on the release branch but never merged back to main.

Cherry-picked commits:

  1. [release/13.2] VS Code Extension: Add right-click context menu on resource endpoint URLs #15347 — Add right-click context menu on resource endpoint URLs
  2. Clean up Aspire panel: context menus, loading state, welcome messages #15375 — Clean up Aspire panel: context menus, loading state, welcome messages
  3. Add AppHost CodeLens and gutter decoration support #15397 — Add AppHost CodeLens and gutter decoration support (new files: CodeLens provider, gutter decorations, parsers, tests)
  4. Fix dashboard image in marketplace README and bump extension version to 1.0.6 #15379 — Fix dashboard image in marketplace README and bump version to 1.0.6
  5. Update CI workflow owner guards and repo references from dotnet to microsoft #15466 (extension-only portion) — Fix dashboard image URL: dotnet/aspire → microsoft/aspire

Notes:

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

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 <[email protected]>
Co-authored-by: Copilot <[email protected]>
…#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 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
Copilot AI review requested due to automatic review settings March 23, 2026 20:18
@github-actions

Copy link
Copy Markdown
Contributor

🚀 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 -- 15502

Or

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Forward-ports VS Code extension updates from release/13.2 to main, expanding the Aspire panel UX (context menus + loading/welcome states) and adding editor integrations (AppHost CodeLens + gutter decorations) backed by new parsers and tests.

Changes:

  • Add richer tree view items + context menu commands (copy/open URLs, copy PIDs/apphost paths, improved dashboard URL handling).
  • Introduce AppHost editor features: CodeLens actions + gutter status decorations, plus C#/JS/TS AppHost resource parsers and supporting utilities/tests.
  • Update extension packaging/docs (new settings + commands, loading/welcome strings, version bump, README image URL); small playground updates.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
playground/TypeScriptApps/RpsArena/apphost.ts Adds pgAdmin to the sample Postgres resource chain.
playground/TypeScriptApps/RpsArena/.modules/transport.ts Adds an authentication step to the JSON-RPC connection establishment.
extension/src/views/AspireAppHostTreeProvider.ts New tree item types (endpoint URL + PID), context menu support, resource reveal ancestry support, and clipboard/browser commands.
extension/src/views/AppHostDataRepository.ts Adds loading state/context handling and adjusts workspace/global error/welcome behavior.
extension/src/editor/resourceConstants.ts Centralizes resource state/health/style/type string constants for consistent UI logic.
extension/src/editor/resourceStateUtils.ts Adds helpers to match workspace/runtime resources to source-defined names.
extension/src/editor/parsers/AppHostResourceParser.ts Adds parser registry abstraction and supported language resolution.
extension/src/editor/parsers/csharpAppHostParser.ts Adds regex-based C# AppHost resource parsing + statementStartLine computation.
extension/src/editor/parsers/jsTsAppHostParser.ts Adds regex-based JS/TS AppHost resource parsing + statementStartLine computation.
extension/src/editor/AspireCodeLensProvider.ts Adds CodeLens for pipeline-step debug and resource state/actions/logs.
extension/src/editor/AspireGutterDecorationProvider.ts Adds gutter dot decorations reflecting live resource state (debounced updates).
extension/src/extension.ts Wires up CodeLens + gutter providers and registers new tree/context menu commands.
extension/src/loc/strings.ts Adds localized strings for CodeLens labels/actions.
extension/package.json Adds new contributions: settings, commands, view welcome/loading entries, and view item context menus; bumps version.
extension/package.nls.json Adds localized strings for new settings/commands/welcome messages.
extension/loc/xlf/aspire-vscode.xlf Adds XLF entries for new strings and updated global view title.
extension/README.md Fixes marketplace image rendering by switching to raw GitHub URL.
extension/src/test/appHostTreeView.test.ts Updates tests to use centralized resource constants.
extension/src/test/resourceStateUtils.test.ts Adds coverage for resource matching logic across apphosts/workspace.
extension/src/test/codeLens.test.ts Adds coverage for CodeLens state label mapping.
extension/src/test/parsers.test.ts Adds comprehensive coverage for C#/JS/TS AppHost parsers and registry behavior.

Comment on lines +124 to +129
const codeLensResourceActionRegistration = vscode.commands.registerCommand('aspire-vscode.codeLensResourceAction', (resourceName: string, action: string, appHostPath: string) => {
let command = `resource "${resourceName}" ${action}`;
if (appHostPath) {
command += ` --apphost "${appHostPath}"`;
}
terminalProvider.sendAspireCommandToAspireTerminal(command);

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

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

The CodeLens resource action handler builds resource "<name>" ${action} without quoting action. For custom resource commands (where the command key may contain spaces or other shell-significant characters), this can produce an invalid CLI command, and it’s also inconsistent with the tree view’s executeResourceCommand path which quotes the selected command. Consider quoting/escaping the action/command name when building the CLI string.

Copilot uses AI. Check for mistakes.
for (const sibling of siblings) {
const children = this.getChildren(sibling);
for (const child of children) {
if (child.id === target.id) {

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

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

getParent/_findParent matches children by child.id === target.id, but PidItem and EndpointUrlItem never set id (so both are undefined). That can cause incorrect parent resolution (any undefined-id child will match), which can break TreeView navigation/reveal behavior for those items. Fix by assigning stable unique ids for these item types (e.g. pid:<pid> / endpoint:<url>) or by guarding the comparison (only compare when both ids are defined).

Suggested change
if (child.id === target.id) {
if (child.id !== undefined && target.id !== undefined && child.id === target.id) {

Copilot uses AI. Check for mistakes.
Comment on lines +430 to +433
private _updateLoadingContext(): void {
const isLoading = this._viewMode === 'workspace' ? this._loadingWorkspace : this._loadingGlobal;
vscode.commands.executeCommand('setContext', 'aspire.loading', isLoading);
}

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

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

The new loading context (aspire.loading) is only ever cleared (when data arrives / errors), but it is never set back to true when a new fetch cycle starts (e.g., refresh() restarting describe/polling, or when entering a mode that hasn’t loaded yet). This can leave the UI showing the non-loading welcome state while a refresh is in progress. Consider explicitly setting _loadingWorkspace/_loadingGlobal back to true at the start of refresh/poll start, and calling _updateLoadingContext() immediately so the loading welcome message is shown consistently.

Copilot uses AI. Check for mistakes.
Comment on lines +73 to +82
// Skip lines that are comments (// or /* or * continuation)
while (line < matchLine) {
const lineText = document.lineAt(line).text.trimStart();
if (lineText.startsWith('//') || lineText.startsWith('/*') || lineText.startsWith('*')) {
line++;
} else {
break;
}
}
return line;

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

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

_findStatementStartLine stops skipping when it encounters a blank line after comments. In a pattern like // comment\n\nconst x = builder\n .addRedis(...), this will return the blank line, placing CodeLens/decoration above the statement. Consider also skipping blank/whitespace-only lines while advancing past comments (e.g., treat lineText.length === 0 as skippable).

Copilot uses AI. Check for mistakes.
Comment on lines +74 to +83
// Skip lines that are comments (// or /* or * continuation)
while (line < matchLine) {
const lineText = document.lineAt(line).text.trimStart();
if (lineText.startsWith('//') || lineText.startsWith('/*') || lineText.startsWith('*')) {
line++;
} else {
break;
}
}
return line;

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

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

_findStatementStartLine stops skipping when it encounters a blank line after comments. If there’s a blank line between comment(s) and the statement, this can return the blank line and place CodeLens/decoration above the statement. Consider skipping blank/whitespace-only lines in the same loop that skips comment lines.

Copilot uses AI. Check for mistakes.
@adamint
Adam Ratzman (adamint) enabled auto-merge (squash) March 23, 2026 20:45
@github-actions

Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings — 52 recordings uploaded (commit 02fc1d8)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
TypeScriptAppHostWithProjectReferenceIntegration ▶️ View Recording

📹 Recordings uploaded automatically from CI run #23458121147

@joperezr

Copy link
Copy Markdown
Member

Failing check is unrelated.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit cde51ba into main Mar 23, 2026
744 of 754 checks passed
@joperezr
Jose Perez Rodriguez (joperezr) deleted the forward-port/extension-13.2-to-main branch March 23, 2026 21:06
@joperezr Jose Perez Rodriguez (joperezr) added this to the 13.3 milestone Apr 14, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

No documentation PR is required for this change.

This PR is a forward port of VS Code extension changes from release/13.2 to main (CodeLens provider, gutter decorations, context menu improvements, welcome messages). Since these features were already shipped in release/13.2, any documentation updates would have been addressed when the originating PRs (#15347, #15375, #15397, #15379) were first merged to that release branch. This PR only brings those already-released extension changes into main.

Generated by PR Documentation Check · ● 151.8K · ◷

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants