-
Notifications
You must be signed in to change notification settings - Fork 206
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
[vscode-spring-boot] Connect to launched spring boot app directly #738
Comments
Hello @testforstephen! Can you recommend any good way to get process id corresponding to the java process launched for the DebugSession? Think it'd be great to get the PID somehow with
|
When handling runInTerminal DAP request, the Java process running on the terminal is owned by VS Code client. And the value "shellProcessId" you see is actually returned by VS Code client. Java Debugger cannot get the PID directly as well. The shellProcessId should be the parent process of the actual Java process, how about using it to find the right Java process? |
@testforstephen I suppose you're suggesting getting a child process id (java process pid) from the parent process id ( I thought you have the pid of the java process here: https://github.com/microsoft/java-debug/blob/a0e31fc8bda7dbe604ef94aabd769bfb0a26bbbc/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchWithDebuggingDelegate.java#L109 |
yes, you can refer to processTree.ts code to find the child process of shellProcessId. When launched in terminal, the debugger will spell out the Java command line first and send it to the terminal (shell). It's the terminal that starts the Java process, and the debugger attaches to that process via a local socket port. You will see When launched in internalConsole, the Java process is started by the debugger using Java API |
@testforstephen Any chance you could add support for me to call: (I've attempted to add it myself but wasn't able to do it properly - was getting "Unrecognized request..." for my message) Tried adding in where
|
@BoykoAlex I add a PR at Java debugger side. microsoft/java-debug#399 |
@BoykoAlex Isn't this already done as part of the latest release of the Spring Boot extension for VSCode? |
Yes, this all done now and even released. |
Currently app boot launched from vscode can either be connected to show live hovers manually via the command or by enabling
boot-java.live-information.automatic-tracking.on
which turns on resources consuming spring boot process tracker machinery on the LS side.If it is possible to extract the PID of the launched spring boot app the direct connection to the app can be established without having spring boot process tracker working on the LS side.
PID from VSCode: #733 (comment)
Discuss with @martinlippert the connect/reconnect/disconnect commands: #733 (comment)
Also new preference setting might be needed to automatically connect on startup as well removing
boot-java.live-information.automatic-tracking.on
and other settings related to process tracking from VSCode UI.(cc: @martinlippert @Eskibear)
The text was updated successfully, but these errors were encountered: