Check aspire exists on path before command or starting aspire debug session#12773
Merged
adamint merged 6 commits intodotnet:mainfrom Nov 7, 2025
Merged
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12773Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12773" |
Contributor
There was a problem hiding this comment.
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
AspireTerminalProviderinstead 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 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mitchdenny
approved these changes
Nov 6, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
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:
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
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate