Skip to content

Add Go AppHost editor support and debugger readiness coverage - #21826

Merged
David Pine (IEvangelist) merged 3 commits into
mainfrom
ievangelist-go-editor-debug-readiness
Nov 6, 2026
Merged

David Pine (IEvangelist) merged 3 commits into
mainfrom
ievangelist-go-editor-debug-readiness

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Description

Adds Go AppHost resource parsing for CodeLens and gutter indicators, and offers the existing debugger setup flow before debugging a Go, Java, or Rust AppHost with missing debugger extensions. Selecting Set Up or dismissing the prompt cancels this launch without a duplicate launch-failure notification/history entry. Run Without Debugging remains available.

Nested and parenthesized Go resource expressions retain their declaration's CodeLens/gutter anchor. The README documents that golang.go's toolchain settings govern the debugger, while Aspire CLI resolves Go from its environment.

Adds Go AppHost-and-resource source-breakpoint coverage to the existing resource-debug E2E shard. Generated AppHosts require Go 1.26, but the old Delve v1.25.2 rejects that toolchain. Provisioning now selects Go 1.26.10 and Delve v1.27.2 without disabling compatibility checks or changing action pins. Go code-generation changes select extension E2E through both affected-project and path-fallback routing.

Relates to #21201, #21213, #21114, and #21115. Builds on already-merged #21187 and #18602. #21211 remains open for live restart validation; restart lifecycle/policy changes are intentionally deferred.

Validation

Latest head ccded4f4cf: actual CI logs inspected, not just job conclusions.

Scenario Linux Windows
Public Debug-command dismissal of missing Go debugger; no duplicate error, session/process, pending launch, or installer invocation Passed; tree-actions 7/7 Passed; tree-actions 7/7
Next multi-root action-routing scenario after temporary Go fixture cleanup Passed in the same shard Passed in the same shard
Real source breakpoints in both Go AppHost and Go resource using packaged Delve Passed, 19.488 seconds; shard 4 passing / 4 pending Passed, 26.818 seconds; shard 5 passing / 3 pending
Full extension unit suite See PR checks 4151 passing / 9 pending

All four E2E jobs had an empty advisory-issue setting; these were not masked failures. Both resource-debug shards also cover existing Go resource attach/Run Without Debugging attach behavior. The prior 6be2b99a45 Go breakpoint scenario also passed on Linux and Windows. These results supersede the original unverified-breakpoint statement.

The first dismissal E2E revision passed its new scenario on both platforms but failed the next existing multi-root scenario: deleting the temporary Go fixture left its repository selection stale. ccded4f4cf refreshes discovery and waits for the primary selection during teardown. Latest-head CI above confirms both consecutive scenarios pass.

First added failing regressions reproducing both reviewer findings (nested calls anchored to line 0; setup/dismissal produced StartDebuggingDeclined). After fixes, these commands passed from extension:

corepack yarn compile-tests
corepack yarn lint
corepack yarn compile
corepack yarn unit-test --run out/test/goAppHostParser.test.js --run out/test/aspireCodeLensProvider.test.js --run out/test/appHostLaunchService.test.js --run out/test/appHostTreeView.test.js --run out/test/aspireDebugConfigurationProvider.test.js --run out/test/aspireDebugSession.test.js --run out/test/rpc/interactionServiceTests.test.js --timeout 120000

The focused suite passed 833 tests / 2 pending. It covers the registered public Debug-command callback through the real tree, launch service, and resolver for setup and dismissal, with substituted language-extension lookup, notifications, debugger start, and installer. Assertions cover cancellation telemetry, no duplicate notification/failure-history entry, cleared state, and preserved genuine declined-launch errors after cancellation/token reuse. Parser/lens/gutter coverage includes nested/parenthesized calls and indexed receivers. Bundling passed with the same four pre-existing webpack dependency warnings.

For the fixture-cleanup revision, compile-tests and lint passed again; this command passed 463 tests / 2 pending:

corepack yarn unit-test --run out/test/appHostLaunchService.test.js --run out/test/appHostTreeView.test.js --run out/test/cliSpawn.test.js --timeout 120000

Earlier failures disclosed: initial Windows CI on 4285826199 had 4149 passing / 9 pending / 2 failing global fake-timer-count assertions in unchanged POSIX cleanup tests. An independently initiated same-head rerun passed 4151 / 9 pending; latest-head CI also passes all 4151. No process-lifecycle/timer-policy changes were made. A full local Windows corepack yarn unit-test --timeout 120000 had 4149 passing / 9 pending / 2 failing unchanged download-cache file-identity/symlink timestamp assertions; it is not claimed green.

Earlier extension commands also passed:

corepack yarn generate-schema
corepack yarn unit-test --run out/test/goAppHostParser.test.js --run out/test/parsers.test.js --run out/test/aspireCodeLensProvider.test.js --run out/test/aspireDebugConfigurationProvider.test.js --run out/test/goDebugger.test.js --run out/test/debuggerInstallHints.test.js --run out/test/strings.test.js
corepack yarn unit-test --run out/test/e2eLaunchProfile.test.js --run out/test/aspireDebugSession.test.js --timeout 120000

The focused commands passed 392 and 318 tests respectively. The second initially had 317 passing / 1 timeout at the default 20-second budget; the explicit slow-host budget passed all 318. Schema generation passed with the current source-built CLI and pinned SDK; unrelated generated drift is excluded.

Repository-root commands:

dotnet build src\Aspire.Cli\Aspire.Cli.csproj --nologo --verbosity quiet
dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-launch-profile -- --filter-class 'Infrastructure.Tests.TestTriggerMap.TestTriggerMapTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'
git diff --check

CLI build passed with a NU1903 advisory for the pinned ILCompiler dependency; real-map tests passed 175/175; whitespace checks passed. A broader selector namespace run was not green: 355 passed / 22 failed, including Windows selecting WSL's shim with no /bin/bash and access-denied temporary Git cleanup. The comparison-base script/tests are unchanged from origin/main, and direct execution of the system Bash shim reproduces the missing-shell error.

An isolated Docker control with Go 1.26.10 reproduced the old Delve compatibility failure, then installed v1.27.2 and hit a real main.main source breakpoint.

Remaining live limitations: actual Marketplace installation, missing-Delve UX, and toolbar/keybinding restart across adapters. Successful setup uses a substituted installer in integration coverage rather than contacting Marketplace from offline E2E. No local interactive Go session/screenshots were captured. The installed old Aspire CLI was not used as current-product evidence. Adjacent Python classification, Node/Bun/Deno display-name localization, and download-cache behavior remain outside this PR. Mitch's approved, explicitly non-blocking tree-sitter-go suggestion is a separate follow-up; this PR does not replace its parser or modify dependency manifests for that exploration.

Screenshots / Recordings

This PR includes UI changes. Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally.

  • For before/after comparisons, place them side-by-side or label them clearly.
  • For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video).
  • If you cannot capture visuals now, note what scenario to test and mark this section as TODO.

TODO: capture Go resource CodeLens/gutter indicators and the missing-debugger Set Up prompt. Real Linux/Windows CI verifies breakpoints, running CodeLens, and prompt dismissal, but no local interactive screenshot was captured.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21826

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21826"

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Debug setup flow misreports intentional cancellation as a launch failure with a duplicate error, while nested Go resource declarations can place CodeLens actions above package main.

2 open issues
What changed in this PR

Adds Go AppHost editor support and debugger-readiness checks to the Aspire VS Code extension, building on the existing Go launch and resource-debugging implementations.

Changes:

  • Adds Go resource parsing for CodeLens and gutter state indicators.
  • Offers debugger setup before debugging Go, Java, or Rust AppHosts when required extensions are unavailable, while preserving Run Without Debugging.
  • Adds Go AppHost/resource breakpoint coverage, updates Go and Delve provisioning, and routes Go code-generation changes to extension E2E tests. Live validation of the new scenario remains outstanding.
File Description
tests/​Infrastructure.Tests/​TestTriggerMap/​TestTriggerMapTests.cs Covers Go code-generation E2E routing.
extension/​src/​testing/​e2eStateFileBridge.ts Includes AppHost CodeLens data in debugger proof results.
extension/​src/​test/​parsers.test.ts Verifies Go parser registration.
extension/​src/​test/​goAppHostParser.test.ts Tests Go declarations, strings, and inactive text.
extension/​src/​test/​aspireDebugConfigurationProvider.test.ts Tests debugger setup prompts and non-debug launches.
extension/​src/​test/​aspireCodeLensProvider.test.ts Tests Go CodeLens and gutter state.
extension/​src/​test-e2e/​resourceDebugTools.e2e.test.ts Adds Go AppHost and resource breakpoint coverage.
extension/​src/​loc/​strings.ts Adds the localized AppHost setup message.
extension/​src/​editor/​parsers/​plainTextInactiveOffsets.ts Updates scanner documentation only.
extension/​src/​editor/​parsers/​goAppHostParser.ts Implements Go resource and builder parsing.
extension/​src/​editor/​parsers/​AppHostResourceParser.ts Maps .go files to the Go language.
extension/​src/​editor/​AspireGutterDecorationProvider.ts Registers the Go parser for gutter indicators.
extension/​src/​editor/​AspireCodeLensProvider.ts Registers the Go parser and updates fallback comments.
extension/​src/​debugger/​debuggerInstallHints.ts Reuses debugger installation hints for AppHosts.
extension/​src/​debugger/​AspireDebugConfigurationProvider.ts Checks debugger availability before launch.
extension/​README.md Documents Go editor support and debugger toolchain settings.
extension/​package.nls.json Adds the debugger setup localization entry.
extension/​loc/​xlf/​aspire-vscode.xlf Includes the new message in translation sources.
eng/​github-ci/​test-trigger-map.yml Routes Go code-generation changes to extension E2E.
.github/​workflows/​extension-e2e-tests.yml Selects compatible Go and Delve versions.

Review effort: Balanced

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the Go AppHost editor support, debugger setup flow, end-to-end debugging coverage, and CI routing changes.

I agree with the two existing comments about setup cancellation being reported as a launch failure and nested Go expressions putting CodeLens on the wrong line. I didn't find anything else to flag.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Valid multiline Go chains place multiple resources’ CodeLens actions and gutter indicators on the same line because resource ranges use selector-dot positions rather than method-token positions.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Use method position for multiline resource lenses

extension/​src/​editor/​parsers/​goAppHostParser.ts:88

For a valid multiline Go chain such as db := builder.AddPostgres("pg"). followed by AddDatabase("db"), both selector dots are on the first line. AspireCodeLensProvider uses range.start.line to separate resources sharing a statement, so both resources' state/action lenses stack above AddPostgres, and the database gutter indicator is also placed on that line. Use the method token's position when the selector crosses a newline, and add a multiline multi-resource regression case.

2 resolved since last review

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Tests selector

1 / 101 PR test projects · 2 PR jobs, from 25 changed files.

Selected PR test projects (1 / 101)

Infrastructure.Tests

Selected PR jobs (2)

extension-e2e, extension-unit


How these were chosen — grouped by what changed

📄 .github/workflows/extension-e2e-tests.yml (changed)
→ 1 directly: Infrastructure.Tests

📄 eng/github-ci/test-trigger-map.yml (changed)
→ 1 directly: Infrastructure.Tests

🧪 tests/Infrastructure.Tests/TestTriggerMap/TestTriggerMapTests.cs (changed test)
→ 1 directly: Infrastructure.Tests

Job reasons

Job Triggered by
extension-e2e .github/workflows/extension-e2e-tests.yml, extension/loc/xlf/aspire-vscode.xlf, extension/package.nls.json, extension/src/debugger/AspireDebugConfigurationProvider.ts, extension/src/debugger/debuggerInstallHints.ts, extension/src/editor/AspireCodeLensProvider.ts, extension/src/editor/AspireGutterDecorationProvider.ts, extension/src/editor/parsers/AppHostResourceParser.ts, extension/src/editor/parsers/goAppHostParser.ts, extension/src/editor/parsers/plainTextInactiveOffsets.ts, extension/src/loc/strings.ts, extension/src/services/AppHostLaunchService.ts, extension/src/test-e2e/resourceDebugTools.e2e.test.ts, extension/src/test-e2e/treeActions.e2e.test.ts, extension/src/test/appHostLaunchService.test.ts, extension/src/test/appHostTreeView.test.ts, extension/src/test/aspireCodeLensProvider.test.ts, extension/src/test/aspireDebugConfigurationProvider.test.ts, extension/src/test/aspireDebugSession.test.ts, extension/src/test/goAppHostParser.test.ts, extension/src/test/parsers.test.ts, extension/src/test/rpc/interactionServiceTests.test.ts, extension/src/testing/e2eStateFileBridge.ts
extension-unit .github/workflows/extension-e2e-tests.yml, extension/loc/xlf/aspire-vscode.xlf, extension/package.nls.json, extension/src/debugger/AspireDebugConfigurationProvider.ts, extension/src/debugger/debuggerInstallHints.ts, extension/src/editor/AspireCodeLensProvider.ts, extension/src/editor/AspireGutterDecorationProvider.ts, extension/src/editor/parsers/AppHostResourceParser.ts, extension/src/editor/parsers/goAppHostParser.ts, extension/src/editor/parsers/plainTextInactiveOffsets.ts, extension/src/loc/strings.ts, extension/src/services/AppHostLaunchService.ts, extension/src/test-e2e/resourceDebugTools.e2e.test.ts, extension/src/test-e2e/treeActions.e2e.test.ts, extension/src/test/appHostLaunchService.test.ts, extension/src/test/appHostTreeView.test.ts, extension/src/test/aspireCodeLensProvider.test.ts, extension/src/test/aspireDebugConfigurationProvider.test.ts, extension/src/test/aspireDebugSession.test.ts, extension/src/test/goAppHostParser.test.ts, extension/src/test/parsers.test.ts, extension/src/test/rpc/interactionServiceTests.test.ts, extension/src/testing/e2eStateFileBridge.ts

Selection computed for commit ccded4f.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the Go AppHost editor support and debugger-setup changes.

No open issues 🎉

Review effort: Balanced

@IEvangelist
David Pine (IEvangelist) merged commit 54b4929 into main Nov 6, 2026
99 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 6, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2070

Generated by PR Documentation Check · copilot · auto · 19.2 AIC · ⌖ 1.17 AIC · ⊞ 7.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#2070 targeting release/17.0.

Updated the VS Code extension page: CodeLens now covers Go AppHosts, and documented the missing-debugger setup prompt for Go/Java/Rust AppHosts. Triggered signal: pr_body_has_cli_flag_mention (PR body).

Note

This draft PR needs human review before merging.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants