Strumenta / kolasu-languageserver-library

1 stars 0 forks source link

Add option to attach debugger to the language server process #76

Open martin-azpillaga opened 1 month ago

martin-azpillaga commented 1 month ago

Currently, the language server is started with the command:

java -jar <path_to_jar>

I suggest adding a boolean flag to the gradle plugin's configuration called development:

languageServer {
    development = true // false by default
}

that when enabled adds the following jvm configuration to the language server process:

java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005,quiet=y -jar <path_to_jar>

This way, editors can attach to the running process in port 5005 and enable debugging the language server. I have successfully managed to do it from vscode by modifying the command manually.