4

I'm currently writing a language server (atop of lsp4j), and need to debug my language server. Language server protocol servers uses stdin and stdout to communicate with the client.

Now I want to debug a server that is launched from the client (VSCode), so I added in the debug flags for the spawned JVM process:

-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999

Upon doing this suddenly, the server does not work any more, even though suspend = 0 and I confirmed the port is open and that no firewall malarkey is happening.

I decided to run the command line manually, and I see that the first thing that a process does, after it receives the debug parameters is to output the following to stdout:

Listening for transport dt_socket at address: 9999

(emitted without double quotes)

I believe this is the reason that I cannot debug the language server, because outputting anything to stdout or stdin that is not part of the language server protocol spec forces the client to reject the server.

My question therefore, in a roundabout fashion is to ask if it is possible to make internal JVM messages on stdout, stdin, stderr silent via another JVM parameter?

Chris
  • 4,450
  • 3
  • 38
  • 49

1 Answers1

6

Update:

The answer appears to be ",quiet=y" as an additional parameter.

-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999,quiet=y

Thank you to Christian Dietrich for providing the solution on the lsp4j github page.

Chris
  • 4,450
  • 3
  • 38
  • 49