Skip to content

[VS Code] "Add Aspire to this workspace" is still offered when Aspire is already present #20022

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The Aspire pane's Create with Aspire… action (aspire-vscode.createWithAspire) always offers both Create a new Aspire app and Add Aspire to this workspace, even when the workspace already has an AppHost. Offering aspire init again in that case doesn't make sense — Aspire is already set up.

Confirmed on origin/main (extension/src/commands/createWithAspire.ts): the quick-pick items array is built unconditionally with both entries and never checks whether an AppHost already exists in the workspace before showing them.

This was called out as an explicit acceptance criterion in #19499 ("Initialization is only offered for applicable workspace folders without an AppHost") but was never implemented when that feature shipped in #19539. The PR's own E2E test (workspaceTargetProof.e2e.test.ts) only exercises a 3-folder workspace where two folders lack an AppHost, so the always-both-options behavior went unnoticed.

Expected Behavior

Add Aspire to this workspace should be hidden from the picker when every workspace folder already contains an AppHost. It should remain visible when the workspace is empty, or when at least one folder (in a multi-root workspace) still lacks an AppHost.

Steps To Reproduce

  1. Open a workspace/folder that already has an AppHost (e.g. run aspire new first).
  2. Open the Aspire pane and click Create with Aspire… (or run "Aspire: Create with Aspire..." from the Command Palette).
  3. Observe that Add Aspire to this workspace is still offered alongside Create a new Aspire app, even though the workspace already has Aspire set up.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions