Skip to content
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

Allow for addition of projectName in the debug #226

Closed
mixtoism opened this issue Jun 30, 2022 · 4 comments
Closed

Allow for addition of projectName in the debug #226

mixtoism opened this issue Jun 30, 2022 · 4 comments

Comments

@mixtoism
Copy link

mixtoism commented Jun 30, 2022

vscode java debugger requires a projectName field in the debugger in order to properly find the related classes. this change should be implemented in the start debugging request to vscode adding the appropiate field.

example of a working launch.json

    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Debug in Wildfly",
            "request": "attach",
            "hostName": "localhost",
            "port": "52356",
            "projectName": "projectName" --> this name matches the artifact id tag in the pom.xml
        },

Appropiate changes should be made in src/debug/javaDebugSession.ts:33-42

private async startDebugger(port: string) {
        this.port = port;
        vscode.debug.startDebugging(undefined, {
            type: 'java',
            request: 'attach',
            name: 'Debug (Remote)',
            hostName: 'localhost',
            port,
           projectName, // this could be asked via the prompt to the user or acquired somehow
        });
    }
@robstryker
Copy link
Collaborator

Pinging @fbricon privately on this issue to see if he has any advice. Specifically, some users may deploy multiple projects to a server and thus need multiple project names to be part of the launch. Asking to see if that's possible at all.

@robstryker
Copy link
Collaborator

I opened microsoft/vscode-java-debug#1197 to allow the possibility to add multiple projects, since users may deploy multiple deployments to a single server. But until that is addressed, I'll go with a solution like you've suggested.

robstryker added a commit to robstryker/vscode-rsp-ui that referenced this issue Jul 28, 2022
…n connecting to debugger

Signed-off-by: Rob Stryker <rob@oxbeef.net>
robstryker added a commit to robstryker/vscode-rsp-ui that referenced this issue Jul 28, 2022
…n connecting to debugger

Signed-off-by: Rob Stryker <rob@oxbeef.net>
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

No branches or pull requests

3 participants
@robstryker @mixtoism and others