Improve extension AppHost output handling and CodeLens anchors#16799
Closed
adamint wants to merge 1 commit into
Closed
Improve extension AppHost output handling and CodeLens anchors#16799adamint wants to merge 1 commit into
adamint wants to merge 1 commit into
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16799Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16799" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Aspire VS Code extension UX around (1) workspace aspire describe --follow watching behavior, (2) debug-session CLI output rendering, and (3) CodeLens anchoring for fluent resource declarations—without requiring any CLI/hosting changes.
Changes:
- Prevents an infinite restart loop when
aspire describe --followexits without producing any data (common when no AppHost is running /--followunsupported). - Buffers Aspire CLI stdout/stderr by line in debug sessions (and forces UTF-8 decoding) to avoid chunk-splitting issues and corrupted multi-byte characters; stops adding an extra “❌” prefix to every stderr line.
- Adjusts CodeLens anchoring logic so single-resource fluent chains anchor at the statement start, while multi-resource chains keep per-call anchoring; adds unit tests for this behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| extension/src/views/AppHostDataRepository.ts | Stops quietly (no auto-restart) when describe --follow exits without producing data; keeps backoff restart only for previously-working streams. |
| extension/src/debugger/languages/cli.ts | Sets stdout/stderr stream encoding to UTF-8 and passes decoded string chunks through callbacks. |
| extension/src/debugger/AspireDebugSession.ts | Adds per-stream line buffering + exit-time flush; removes blanket stderr “❌” prefixing and preserves chunk integrity. |
| extension/src/editor/AspireCodeLensProvider.ts | Updates resource CodeLens anchor selection based on whether resources share the same statement start. |
| extension/src/test/aspireCodeLensProvider.test.ts | Adds mocha types reference and unit tests validating CodeLens anchoring behavior for single- vs multi-resource fluent chains. |
Member
Author
|
Superseded by #16795, which now includes this focused slice. |
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
Improves several extension-only AppHost UX paths without requiring CLI or hosting changes:
❌; CLI/Spectre error output already includes the appropriate prefix, while benign stderr messages such as update notifications should not be labeled as failures.aspire describe --followrestart loop when the follow process exits before producing data.Validation:
npm run compile-testsnpm run unit-test | grep -A3 "AspireCodeLensProvider resource lens anchoring"Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: