Skip to content

Conversation

marshalhayes
Copy link
Contributor

@marshalhayes marshalhayes commented Oct 16, 2025

This PR enables Java debugger support for the Aspire VSCode extension.

This requires a corresponding change in dotnet/aspire:#12076

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

@marshalhayes marshalhayes marked this pull request as ready for review October 17, 2025 03:13
@Copilot Copilot AI review requested due to automatic review settings October 17, 2025 03:13
Copy link
Contributor

@Copilot 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 enables Java debugging support in the Aspire VS Code extension by wiring the Java app resource to VS Code debug tooling.

  • Adds VS Code debug support to Java executable resources via WithVSCodeDebugSupport.
  • Suppresses experimental API analyzer around the new call.

.WithEnvironment("JAVA_TOOL_OPTIONS", $"-javaagent:{options.OtelAgentPath?.TrimEnd('/')}/opentelemetry-javaagent.jar")
.WithEnvironment("SERVER_PORT", options.Port.ToString(CultureInfo.InvariantCulture));
.WithEnvironment("SERVER_PORT", options.Port.ToString(CultureInfo.InvariantCulture))
.WithVSCodeDebugSupport(builder.Resource.WorkingDirectory, "java", "vscjava.vscode-java-pack");
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

Use the Java Debug extension ID instead of the extension pack to ensure accurate detection for users who have only the debugger installed. Replace vscjava.vscode-java-pack with vscjava.vscode-java-debug.

Suggested change
.WithVSCodeDebugSupport(builder.Resource.WorkingDirectory, "java", "vscjava.vscode-java-pack");
.WithVSCodeDebugSupport(builder.Resource.WorkingDirectory, "java", "vscjava.vscode-java-debug");

Copilot uses AI. Check for mistakes.

.WithEnvironment("JAVA_TOOL_OPTIONS", $"-javaagent:{options.OtelAgentPath?.TrimEnd('/')}/opentelemetry-javaagent.jar")
.WithEnvironment("SERVER_PORT", options.Port.ToString(CultureInfo.InvariantCulture));
.WithEnvironment("SERVER_PORT", options.Port.ToString(CultureInfo.InvariantCulture))
.WithVSCodeDebugSupport(builder.Resource.WorkingDirectory, "java", "vscjava.vscode-java-pack");
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

New behavior for VS Code Java debugging lacks tests. Please add an xUnit test that exercises a Java app resource configured via WithJavaDefaults and asserts that VS Code debug support metadata/configuration is emitted (e.g., languageId 'java' and the chosen extension ID), following the repo’s testing conventions.

Copilot generated this review using guidance from repository custom instructions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant