Disambiguate VS Code AppHost path labels#16518
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16518Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16518" |
There was a problem hiding this comment.
Pull request overview
Updates the VS Code extension’s AppHost labeling to disambiguate duplicate AppHost filenames by computing shortened labels across the full set of paths (rather than shortening each path independently). This addresses duplicate labels appearing in the tree view, dashboard quick pick, and workspace AppHost label.
Changes:
- Replace single-path
shortenPathusage in global tree rendering and dashboard quick pick with batchedshortenPaths. - Implement
shortenPathsinAppHostDataRepositoryto expand parent segments until labels are unique (with platform-aware comparisons). - Add/extend unit tests covering label disambiguation for global tree items, dashboard quick pick, and workspace AppHost naming.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| extension/src/views/AspireAppHostTreeProvider.ts | Uses shortenPaths to generate disambiguated labels for global tree items and dashboard quick pick entries. |
| extension/src/views/AppHostDataRepository.ts | Adds shortenPaths (and refactors shortenPath to delegate) and uses candidate sets to disambiguate the workspace AppHost label. |
| extension/src/test/appHostTreeView.test.ts | Adds unit tests validating disambiguation behavior in the tree provider, quick pick, and workspace AppHost name resolution. |
JamesNK
left a comment
There was a problem hiding this comment.
I did this in the aspire ps results. Did you copy that? If not, make the results line up.
I added a bunch of unit tests so they can be used to check they're the same.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Re-running the failed jobs in the CI workflow for this pull request because 3 jobs were identified as retry-safe transient failures in the CI run attempt.
Matched test failure patterns (1 test)
|
Description
Fixes #16200
The VS Code extension now shortens AppHost paths as a batch so duplicate filenames gain enough parent segments to be unique in the tree, dashboard quick pick, and workspace AppHost label.
Validation:
npm run compile-tests && npm run unit-test -- --grep "shortenPath|AspireAppHostTreeProvider|AppHostDataRepository" --timeout 10000Before:

After:

Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: