Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d635b5f
Display resource commands in VS Code extension tree view
shivamgoel008 May 29, 2026
23d18a6
Address resource command tree review feedback
adamint May 30, 2026
e431f03
Merge main into resource command tree view branch
adamint May 30, 2026
aa7b6df
Fix resource command context menu after merge
adamint May 30, 2026
0b89a54
Require context menu for AppHost run actions
adamint May 30, 2026
ba7a78f
Restore direct AppHost run actions
adamint May 30, 2026
76f17fb
Preserve legacy resource command compatibility
adamint May 30, 2026
bc68c5d
Fix legacy resource command item execution
adamint May 30, 2026
ac8ae8c
Fix resource command CodeLens edge cases
adamint May 30, 2026
c712c38
Fix extension release workflow credentials
adamint May 30, 2026
f4c0d60
Merge remote-tracking branch 'upstream/main' into copilot/pr17698-rev…
adamint May 30, 2026
80b993e
Add Aspire tree strings to localization source
adamint May 30, 2026
93dd708
Move extension release workflow fix to separate PR
adamint May 30, 2026
df13707
Detect describe --include-disabled-commands via CLI capabilities
adamint May 30, 2026
72ffea4
Render distinct icons for resource commands in tree view
adamint May 31, 2026
f354603
Use neutral gray color for resource command icons
adamint May 31, 2026
2c1aace
Fix resource command exposure in VS Code tree
adamint May 31, 2026
e0325cc
Merge upstream main into e17698
adamint Jun 2, 2026
5cf8819
Add VS Code resource command E2E implementation plan
adamint Jun 2, 2026
62a0456
Expand VS Code resource command E2E edge cases
adamint Jun 2, 2026
6a13fe4
Add multi-model review step to E2E plan
adamint Jun 2, 2026
9f6cb14
Update zero-to-running E2E plan
adamint Jun 2, 2026
d0ea025
Add VS Code resource command E2E coverage
adamint Jun 2, 2026
1c34323
Fix VS Code resource command terminal quoting
adamint Jun 2, 2026
61e0880
Fix E2E shell quote expectations
adamint Jun 2, 2026
337fd45
Fix workspace resource AppHost targeting
adamint Jun 2, 2026
9083548
Fix Windows CLI command execution
adamint Jun 2, 2026
e79aec8
Bump VS Code extension to 1.13.0
adamint Jun 2, 2026
ec58377
Update VS Code E2E harness from latest PR changes
adamint Jun 2, 2026
dfe9fb2
Apply latest VS Code E2E stabilization updates
adamint Jun 2, 2026
b1d9ee1
Align AppHost stop tests with shell quoting
adamint Jun 2, 2026
f9f7bd1
Merge branch 'main' into e17698
adamint Jun 2, 2026
7f44d8c
Fix AppHost repository test after main merge
adamint Jun 2, 2026
5b13e4e
Stabilize VS Code E2E cleanup
adamint Jun 2, 2026
5ba470c
Hide API-only commands from CodeLens
adamint Jun 2, 2026
725e577
Stabilize VS Code E2E CI shards
adamint Jun 2, 2026
1f04ec5
Set Aspire CLI telemetry opt-out for E2E
adamint Jun 2, 2026
5b582de
Remove accidental superpowers plan artifact
adamint Jun 2, 2026
628de02
Include UI-only commands in describe metadata
adamint Jun 2, 2026
2a21899
Merge branch 'main' into e17698
adamint Jun 3, 2026
b66a941
Avoid transient stop state assertion in E2E
adamint Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/extension-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -533,25 +533,29 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
NEW_VERSION: ${{ inputs.release_version }}
REPOSITORY: ${{ github.repository }}
SERVER_URL: ${{ github.server_url }}
run: |
set -eo pipefail

WORK_DIR="${RUNNER_TEMP}/extension-release/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
BRANCH_NAME="extension-release/v${NEW_VERSION}"

# Configure git author metadata. The GitHub App token is supplied only to
# the commands that need it so it is not persisted in .git/config.
# Configure git credentials before any Git network operation so Git never
# falls back to an interactive username prompt on the hosted runner.
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
export GIT_TERMINAL_PROMPT=0
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@${SERVER_URL_STRIPPED}/${REPOSITORY}.git"

# Create branch and commit
git checkout -B "$BRANCH_NAME"
git add extension/package.json extension/CHANGELOG.md
git commit -m "Prepare VS Code extension release v${NEW_VERSION}"
if git -c http.extraHeader="AUTHORIZATION: bearer ${GH_TOKEN}" ls-remote --exit-code --heads origin "$BRANCH_NAME" >/dev/null 2>&1; then
git -c http.extraHeader="AUTHORIZATION: bearer ${GH_TOKEN}" fetch origin "$BRANCH_NAME:refs/remotes/origin/$BRANCH_NAME"
if git ls-remote --exit-code --heads origin "$BRANCH_NAME" >/dev/null 2>&1; then
git fetch origin "$BRANCH_NAME:refs/remotes/origin/$BRANCH_NAME"
fi
git -c http.extraHeader="AUTHORIZATION: bearer ${GH_TOKEN}" push --force-with-lease origin "$BRANCH_NAME"
git push --force-with-lease origin "$BRANCH_NAME"

# Create or update draft PR. Capture the PR number directly from each
# path (the update path already resolved it; `gh pr create` prints the
Expand Down
6 changes: 6 additions & 0 deletions extension/loc/xlf/aspire-vscode.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@
"category": "Aspire",
"icon": "$(terminal)"
},
{
"command": "aspire-vscode.executeResourceCommandItem",
"title": "%command.executeResourceCommandItem%",
"category": "Aspire",
"icon": "$(terminal)"
},
{
"command": "aspire-vscode.copyEndpointUrl",
"title": "%command.copyEndpointUrl%",
Expand Down Expand Up @@ -541,6 +547,10 @@
"command": "aspire-vscode.executeResourceCommand",
"when": "false"
},
{
"command": "aspire-vscode.executeResourceCommandItem",
"when": "false"
},
{
"command": "aspire-vscode.codeLensDebugPipelineStep",
"when": "false"
Expand Down Expand Up @@ -688,6 +698,11 @@
"when": "view == aspire-vscode.appHosts && viewItem =~ /^resource(:|$)/",
"group": "2_actions@4"
},
{
"command": "aspire-vscode.executeResourceCommandItem",
"when": "view == aspire-vscode.appHosts && viewItem == resourceCommand:enabled",
"group": "2_actions@4"
},
{
"command": "aspire-vscode.viewResourceLogs",
"when": "view == aspire-vscode.appHosts && viewItem =~ /^resource(:|$)/",
Expand Down
4 changes: 3 additions & 1 deletion extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"command.restartResource": "Restart",
"command.viewResourceLogs": "View logs",
"command.executeResourceCommand": "Execute resource command",
"command.executeResourceCommandItem": "Execute command",
"command.copyEndpointUrl": "Copy URL",
"command.openInExternalBrowser": "Open in browser",
"command.openInIntegratedBrowser": "Open in VS Code",
Expand Down Expand Up @@ -204,5 +205,6 @@
"aspire-vscode.strings.resourceCommandContinue": "Continue",
"aspire-vscode.strings.resourceCommandDontShowAgain": "Don't show again",
"aspire-vscode.strings.resourceCommandInvalidNumber": "Enter a number using invariant culture, for example 1, -1.5, or 1e3.",
"aspire-vscode.strings.resourceCommandMaxLength": "Value must be {0} characters or fewer."
"aspire-vscode.strings.resourceCommandMaxLength": "Value must be {0} characters or fewer.",
"aspire-vscode.strings.resourceCommandDisabledDescription": "(disabled)"
}
49 changes: 28 additions & 21 deletions extension/src/editor/AspireCodeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppHostResourceParser, getParserForDocument } from './parsers/AppHostRe
// Import parsers to trigger self-registration
import './parsers/csharpAppHostParser';
import './parsers/jsTsAppHostParser';
import { AspireAppHostTreeProvider } from '../views/AspireAppHostTreeProvider';
import { AspireAppHostTreeProvider, isEnabledCommand } from '../views/AspireAppHostTreeProvider';
import { AppHostDataRepository, ResourceJson, AppHostDisplayInfo, ResourceCommandJson } from '../views/AppHostDataRepository';
import { findResourceState, findWorkspaceResourceState, matchesAppHostPathOrDirectory } from './resourceStateUtils';
import { ResourceState, HealthStatus, StateStyle, ResourceType } from './resourceConstants';
Expand Down Expand Up @@ -236,7 +236,7 @@ export class AspireCodeLensProvider implements vscode.CodeLensProvider {
const state = resource.state ?? '';
const stateStyle = resource.stateStyle ?? '';
const healthStatus = resource.healthStatus;
const commands = resource.commands ? Object.keys(resource.commands) : [];
const commands = resource.commands ?? {};

// State indicator lens (clickable — reveals resource in tree view)
let stateLabel = getCodeLensStateLabel(state, stateStyle, resource.exitCode);
Expand Down Expand Up @@ -268,30 +268,33 @@ export class AspireCodeLensProvider implements vscode.CodeLensProvider {
}));

// Action lenses based on available commands
if (commands.includes('restart') || commands.includes('resource-restart')) {
const restartCommand = getEnabledCommand(commands, 'restart', 'resource-restart');
if (restartCommand) {
lenses.push(new vscode.CodeLens(range, {
title: codeLensRestart,
command: 'aspire-vscode.codeLensResourceAction',
tooltip: codeLensRestart,
arguments: [resource.name, 'restart', appHost.appHostPath],
arguments: [resource.name, 'restart', appHost.appHostPath, restartCommand],
}));
}

if (commands.includes('stop') || commands.includes('resource-stop')) {
const stopCommand = getEnabledCommand(commands, 'stop', 'resource-stop');
if (stopCommand) {
lenses.push(new vscode.CodeLens(range, {
title: codeLensStop,
command: 'aspire-vscode.codeLensResourceAction',
tooltip: codeLensStop,
arguments: [resource.name, 'stop', appHost.appHostPath],
arguments: [resource.name, 'stop', appHost.appHostPath, stopCommand],
}));
}

if (commands.includes('start') || commands.includes('resource-start')) {
const startCommand = getEnabledCommand(commands, 'start', 'resource-start');
if (startCommand) {
lenses.push(new vscode.CodeLens(range, {
title: codeLensStart,
command: 'aspire-vscode.codeLensResourceAction',
tooltip: codeLensStart,
arguments: [resource.name, 'start', appHost.appHostPath],
arguments: [resource.name, 'start', appHost.appHostPath, startCommand],
}));
}

Expand All @@ -307,19 +310,17 @@ export class AspireCodeLensProvider implements vscode.CodeLensProvider {

// Custom commands (non-standard ones like "Reset Database")
const standardCommands = new Set(['restart', 'resource-restart', 'stop', 'resource-stop', 'start', 'resource-start']);
if (resource.commands) {
for (const [cmdName, cmd] of Object.entries(resource.commands) as [string, ResourceCommandJson][]) {
if (!standardCommands.has(cmdName)) {
const displayName = getNormalizedCommandText(cmd.displayName);
const description = getNormalizedCommandText(cmd.description);
const label = codeLensCommand(displayName ?? cmdName);
lenses.push(new vscode.CodeLens(range, {
title: label,
command: 'aspire-vscode.codeLensResourceAction',
tooltip: description ?? displayName ?? cmdName,
arguments: [resource.name, cmdName, appHost.appHostPath, cmd],
}));
}
for (const [cmdName, cmd] of Object.entries(commands) as [string, ResourceCommandJson][]) {
if (!standardCommands.has(cmdName) && isEnabledCommand(cmd)) {
const displayName = getNormalizedCommandText(cmd.displayName);
const description = getNormalizedCommandText(cmd.description);
const label = codeLensCommand(displayName ?? cmdName);
lenses.push(new vscode.CodeLens(range, {
title: label,
command: 'aspire-vscode.codeLensResourceAction',
tooltip: description ?? displayName ?? cmdName,
arguments: [resource.name, cmdName, appHost.appHostPath, cmd],
}));
}
}
}
Expand All @@ -330,6 +331,12 @@ export class AspireCodeLensProvider implements vscode.CodeLensProvider {
}
}

function getEnabledCommand(commands: Record<string, ResourceCommandJson>, ...commandNames: string[]): ResourceCommandJson | undefined {
return commandNames
.map(commandName => commands[commandName])
.find(isEnabledCommand);
}

export function getCodeLensStateLabel(state: string, stateStyle: string, exitCode?: number | null): string {
switch (state) {
case ResourceState.Running:
Expand Down
10 changes: 8 additions & 2 deletions extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { openLocalSettingsCommand, openGlobalSettingsCommand } from './commands/
import { checkCliAvailableOrRedirect, checkForExistingAppHostPathInWorkspace } from './utils/workspace';
import { AspireEditorCommandProvider } from './editor/AspireEditorCommandProvider';
import { AspirePackageRestoreProvider } from './utils/AspirePackageRestoreProvider';
import { AspireAppHostTreeProvider } from './views/AspireAppHostTreeProvider';
import { AspireAppHostTreeProvider, isEnabledCommand } from './views/AspireAppHostTreeProvider';
import { AppHostDataRepository } from './views/AppHostDataRepository';
import { installCliStableCommand, installCliDailyCommand, verifyCliInstalledCommand } from './commands/walkthroughCommands';
import { AspireMcpServerDefinitionProvider } from './mcp/AspireMcpServerDefinitionProvider';
Expand Down Expand Up @@ -126,6 +126,7 @@ export async function activate(context: vscode.ExtensionContext) {
const restartResourceRegistration = vscode.commands.registerCommand('aspire-vscode.restartResource', (element) => appHostTreeProvider.restartResource(element));
const viewResourceLogsRegistration = vscode.commands.registerCommand('aspire-vscode.viewResourceLogs', (element) => appHostTreeProvider.viewResourceLogs(element));
const executeResourceCommandRegistration = vscode.commands.registerCommand('aspire-vscode.executeResourceCommand', (element) => appHostTreeProvider.executeResourceCommand(element));
const executeResourceCommandItemRegistration = vscode.commands.registerCommand('aspire-vscode.executeResourceCommandItem', (element) => appHostTreeProvider.executeResourceCommandItem(element));
const copyEndpointUrlRegistration = vscode.commands.registerCommand('aspire-vscode.copyEndpointUrl', (element) => appHostTreeProvider.copyEndpointUrl(element));
const openInExternalBrowserRegistration = vscode.commands.registerCommand('aspire-vscode.openInExternalBrowser', (element) => appHostTreeProvider.openInExternalBrowser(element));
const openInIntegratedBrowserRegistration = vscode.commands.registerCommand('aspire-vscode.openInIntegratedBrowser', (element) => appHostTreeProvider.openInIntegratedBrowser(element));
Expand All @@ -144,14 +145,19 @@ export async function activate(context: vscode.ExtensionContext) {
// Activate the data repository. Workspace describe watching and global polling begin when the panel is visible.
dataRepository.activate();

context.subscriptions.push(appHostTreeView, globalRefreshAppHostsRegistration, refreshAppHostsRegistration, switchToGlobalViewRegistration, switchToWorkspaceViewRegistration, openDashboardRegistration, openAppHostSourceRegistration, stopAppHostRegistration, runAppHostRegistration, debugAppHostRegistration, stopResourceRegistration, startResourceRegistration, restartResourceRegistration, viewResourceLogsRegistration, executeResourceCommandRegistration, copyEndpointUrlRegistration, openInExternalBrowserRegistration, openInIntegratedBrowserRegistration, copyResourceNameRegistration, copyAppHostPathRegistration, viewAppHostSourceRegistration, viewAppHostLogFileRegistration, copyLogFilePathRegistration, expandAllRegistration, { dispose: () => { appHostTreeProvider.dispose(); dataRepository.dispose(); } });
context.subscriptions.push(appHostTreeView, globalRefreshAppHostsRegistration, refreshAppHostsRegistration, switchToGlobalViewRegistration, switchToWorkspaceViewRegistration, openDashboardRegistration, openAppHostSourceRegistration, stopAppHostRegistration, runAppHostRegistration, debugAppHostRegistration, stopResourceRegistration, startResourceRegistration, restartResourceRegistration, viewResourceLogsRegistration, executeResourceCommandRegistration, executeResourceCommandItemRegistration, copyEndpointUrlRegistration, openInExternalBrowserRegistration, openInIntegratedBrowserRegistration, copyResourceNameRegistration, copyAppHostPathRegistration, viewAppHostSourceRegistration, viewAppHostLogFileRegistration, copyLogFilePathRegistration, expandAllRegistration, { dispose: () => { appHostTreeProvider.dispose(); dataRepository.dispose(); } });

// CodeLens provider — shows Debug on pipeline steps, resource state on resources
const codeLensProvider = new AspireCodeLensProvider(appHostTreeProvider, dataRepository);
const languageFilters = getSupportedLanguageIds().map(lang => ({ language: lang, scheme: 'file' }));
const codeLensRegistration = vscode.languages.registerCodeLensProvider(languageFilters, codeLensProvider);
const codeLensDebugPipelineStepRegistration = vscode.commands.registerCommand('aspire-vscode.codeLensDebugPipelineStep', (stepName: string) => editorCommandProvider.tryExecuteDoAppHost(false, stepName));
const codeLensResourceActionRegistration = vscode.commands.registerCommand('aspire-vscode.codeLensResourceAction', async (resourceName: string, action: string, appHostPath: string, resourceCommand?: ResourceCommandJson) => {
if (resourceCommand !== undefined && !isEnabledCommand(resourceCommand)) {
extensionLogOutputChannel.warn(`Ignoring disabled CodeLens resource command '${action}' for resource '${resourceName}'.`);
return;
}

const commandArguments = await collectResourceCommandArguments(action, resourceCommand, {
secretWarningState: context.globalState,
loadDynamicArguments: createResourceCommandArgumentLoader({
Expand Down
2 changes: 2 additions & 0 deletions extension/src/loc/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const aspireDescribeMinimumVersion = '13.2.0';
export const aspireCliDescribeNotSupported = (version: string) => vscode.l10n.t('Workspace resources require Aspire CLI {0} or newer. Update the Aspire CLI and refresh the Aspire panel.', version);
export const appHostDescribeMayNotBeSupported = (version: string) => vscode.l10n.t('No workspace resources were returned. Workspace resources require the AppHost to reference Aspire.Hosting {0} or newer.', version);
export const resourcesGroupLabel = vscode.l10n.t('Resources');
export const commandsLabel = vscode.l10n.t('Commands');
export const noCommandsAvailable = vscode.l10n.t('No commands available for this resource.');
export const selectCommandPlaceholder = vscode.l10n.t('Select a command to execute');
export const resourceCommandArgumentsTitle = (command: string) => vscode.l10n.t('Run {0}', command);
Expand All @@ -74,6 +75,7 @@ export const resourceCommandContinue = vscode.l10n.t('Continue');
export const resourceCommandDontShowAgain = vscode.l10n.t("Don't show again");
export const resourceCommandInvalidNumber = vscode.l10n.t('Enter a number using invariant culture, for example 1, -1.5, or 1e3.');
export const resourceCommandMaxLength = (length: number) => vscode.l10n.t('Value must be {0} characters or fewer.', length);
export const resourceCommandDisabledDescription = vscode.l10n.t('(disabled)');
export const selectDashboardPlaceholder = vscode.l10n.t('Select a dashboard to open');
export const workspaceAppHostLabel = vscode.l10n.t('Workspace AppHost');
export const workspaceAppHostsGroupLabel = vscode.l10n.t('Workspace AppHosts');
Expand Down
Loading
Loading