Add VS Code workspace recommendations and launch config to aspire new templates#15532
Add VS Code workspace recommendations and launch config to aspire new templates#15532
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15532Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15532" |
There was a problem hiding this comment.
Pull request overview
Adds post-template scaffolding to aspire new so newly created projects are immediately VS Code-ready (workspace extension recommendation + default Aspire debug configuration), while preserving any existing workspace files.
Changes:
- Generate
.vscode/extensions.jsonrecommendingmicrosoft-aspire.aspire-vscodewhen missing. - Generate
.vscode/launch.jsonwith the default “Aspire: Launch default apphost” configuration when missing. - Add CLI tests validating file creation and non-overwrite behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Commands/NewCommand.cs | Writes VS Code workspace files after successful template creation (without overwriting existing files). |
| tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs | Adds tests for creating VS Code workspace files and ensuring existing files aren’t overwritten. |
|
Re-running the failed jobs in the CI workflow for this pull request because 2 jobs were identified as retry-safe transient failures in the CI run attempt.
|
mitchdenny
left a comment
There was a problem hiding this comment.
We make the assumption that the output path is the root of the workspace, but I think that is probably fine for now. No plans to add it to the recommended extensions if the file already exists?
|
What happens if someone isn't using vscode? How come adding this file is an extra step and not part of the other file creation in scaffolding? Who is the |
…ion-rec-template # Conflicts: # src/Aspire.Cli/Commands/NewCommand.cs
…NewCommand Add .vscode/extensions.json (recommending Aspire extension) and .vscode/launch.json (with Aspire debug config) directly to the four solution templates that include an AppHost: - aspire-empty - aspire-starter - aspire-ts-cs-starter - aspire-py-starter This is better than programmatic generation because it works with all template instantiation paths (dotnet new, aspire new, Visual Studio), not just the Aspire CLI. Remove WriteVsCodeWorkspaceFiles from NewCommand.cs and the three related tests.
|
🎬 CLI E2E Test Recordings — 49 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23520221869 |
|
@davidfowl @DamianEdwards What do you think of including vscode files in templates? |
Description
After
aspire newsuccessfully creates a project from any template, the CLI now generates.vscode/extensions.jsonand.vscode/launch.jsonin the output directory if they don't already exist.microsoft-aspire.aspire-vscodeextension as a workspace recommendationExisting files are preserved — if either file already exists, it is not overwritten.
Fixes #14802
Fixes #14391
Checklist