-
Notifications
You must be signed in to change notification settings - Fork 769
Check aspire exists on path before command or starting aspire debug session #12773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check aspire exists on path before command or starting aspire debug session #12773
Conversation
|
🚀 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" |
There was a problem hiding this 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
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 <[email protected]>
Co-authored-by: Copilot <[email protected]>
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