-
Notifications
You must be signed in to change notification settings - Fork 128
Add VSCode debugger support for executable Java apps #904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add VSCode debugger support for executable Java apps #904
Conversation
There was a problem hiding this 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"); |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
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.
.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"); |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
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.
This PR enables Java debugger support for the Aspire VSCode extension.
This requires a corresponding change in dotnet/aspire:#12076
PR Checklist
Other information