Skip to content

Conversation

@adamint
Copy link
Member

@adamint adamint commented Sep 22, 2025

Description

My initial IDE protocol implementation in the vs code extension did not handle launch profiles properly. This PR handles launch profiles and working directories according to the DCP spec.

I have also added two profiles to the playground/Stress.Empty project that are helpful when manually verifying that it works (such as launch profile env overriding launchSettings.json entries)

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
  • Does the change require an update in our Aspire docs?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11573

Or

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

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 22, 2025
@adamint adamint self-assigned this Sep 22, 2025
@adamint adamint added area-extension and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements proper launch profile support for the VS Code extension according to the DCP specification. The extension now correctly handles launch profiles from launchSettings.json files when debugging .NET projects, including environment variable merging, command line arguments, working directories, and browser launch settings.

Key Changes

  • Added comprehensive launch profile parsing and merging logic
  • Refactored the .NET debugger extension to support launch profile configuration
  • Added test projects with sample launch profiles for manual verification

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
playground/Stress/Stress.Empty/Properties/launchSettings.json Added sample launch profiles for testing launch profile functionality
playground/Stress/Stress.AppHost/Program.cs Updated to use launch profiles and demonstrate environment variable overriding
extension/src/test/launchProfiles.test.ts Comprehensive unit tests for launch profile parsing and merging functions
extension/src/test/dotnetDebugger.test.ts Unit tests for the .NET debugger extension with launch profile integration
extension/src/debugger/launchProfiles.ts Core implementation of launch profile parsing, merging, and configuration logic
extension/src/debugger/languages/dotnet.ts Refactored .NET debugger to integrate launch profile support and extract services
extension/src/debugger/debuggerExtensions.ts Updated interface to support optional args parameter
extension/src/debugger/AspireDebugConfigurationProvider.ts Enhanced debug configuration resolution with better defaults
extension/.gitignore Added VS Code test directory to gitignore

@adamint adamint requested a review from karolz-ms September 23, 2025 06:25
Copy link
Member

@karolz-ms karolz-ms left a comment

Choose a reason for hiding this comment

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

Overall looks great. I particularly like the new test coverage that this PR brings.

I have some questions/suggestions. Some apply to code that was already here before, but this is first time I am looking at it, so bear with me.

@adamint adamint requested a review from karolz-ms September 23, 2025 20:11
@adamint adamint merged commit 2f7aeda into dotnet:main Sep 23, 2025
311 checks passed
@adamint
Copy link
Member Author

adamint commented Sep 23, 2025

/backport to release/9.5

@dotnet-policy-service dotnet-policy-service bot added this to the 9.6 milestone Sep 23, 2025
@github-actions
Copy link
Contributor

Started backporting to release/9.5: https://github.com/dotnet/aspire/actions/runs/17960064421

@github-actions
Copy link
Contributor

@adamint backporting to "release/9.5" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: add vscode-test to gitignore
Applying: change line endings
Applying: update dotnet debugger extension
Applying: fully support launch profiles
Applying: add test profiles to Stress.Empty for manual launch profile support tests
Applying: also validate or provide defaults for launch config on vs code side
Applying: don't parse command line args, apply suggestions
Using index info to reconstruct a base tree...
M	extension/src/loc/strings.ts
Falling back to patching base and 3-way merge...
Auto-merging extension/src/loc/strings.ts
CONFLICT (content): Merge conflict in extension/src/loc/strings.ts
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0007 don't parse command line args, apply suggestions
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copilot AI pushed a commit that referenced this pull request Sep 24, 2025
* add vscode-test to gitignore

* change line endings

* update dotnet debugger extension

* fully support launch profiles

* add test profiles to Stress.Empty for manual launch profile support tests

* also validate or provide defaults for launch config on vs code side

* don't parse command line args, apply suggestions
joperezr pushed a commit that referenced this pull request Sep 25, 2025
…sion (#11617)

* Initial plan

* Add proper launch profile support to the VS Code extension (#11573)

* add vscode-test to gitignore

* change line endings

* update dotnet debugger extension

* fully support launch profiles

* add test profiles to Stress.Empty for manual launch profile support tests

* also validate or provide defaults for launch config on vs code side

* don't parse command line args, apply suggestions

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Adam Ratzman <adam@adamratzman.com>
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants