Skip to content

Conversation

@adamint
Copy link
Member

@adamint adamint commented Nov 6, 2025

Description

Fixes running a custom version of aspire cli on windows, and when aspire is not on the path, complains and bails with the following informational message:

image

It checks for CLI availability by running aspire --version. If that command succeeds, CLI is assumed to be available for the entire lifetime of the extension (in practice, until VS code is restarted or workspace is closed) and the command is not run anymore.

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
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@adamint adamint requested review from Copilot and mitchdenny November 6, 2025 20:20
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12773

Or

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

Copy link
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

This PR refactors CLI path handling to centralize quoting logic and adds a CLI availability check with user-friendly error messaging. The changes improve path handling for special characters and spaces across different platforms while ensuring users are notified when the Aspire CLI is not available.

  • Centralized CLI path quoting logic in AspireTerminalProvider instead of returning pre-quoted paths
  • Added CLI availability check with caching and user-friendly error dialog
  • Updated debug configuration provider to validate CLI availability before starting debug sessions

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
extension/src/utils/workspace.ts Added checkCliAvailableOrRedirect function with caching and error handling; removed surroundWithQuotes parameter usage
extension/src/utils/AspireTerminalProvider.ts Removed surroundWithQuotes parameter from getAspireCliExecutablePath; moved quoting logic into sendAspireCommandToAspireTerminal with platform-specific handling
extension/src/test/aspireTerminalProvider.test.ts Added comprehensive test suite for getAspireCliExecutablePath method
extension/src/loc/strings.ts Added three new localized strings for CLI availability error dialog
extension/src/extension.ts Added CLI availability check in tryExecuteCommand with command exclusion list; updated debug provider constructor
extension/src/debugger/AspireDebugSession.ts Removed false argument from getAspireCliExecutablePath call
extension/src/debugger/AspireDebugConfigurationProvider.ts Added constructor with terminalProvider; added CLI check in resolveDebugConfiguration
extension/package.nls.json Added localization entries for new strings
extension/loc/xlf/aspire-vscode.xlf Added translation units for new localized strings
extension/package.json Bumped version from 0.5.0 to 0.6.0
.github/copilot-instructions.md Added TypeScript and VS Code extension localization guidelines

@adamint adamint merged commit 1018754 into dotnet:main Nov 7, 2025
296 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 7, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants