When successfully implementing a language client – server system, I can not set “trace” to an other value by setTrace
. The server always receives “off”. The client is visual studio code (type script), the server is c++.
This is the command, used in the start up of the server as well as adjusting a running server:
client.setTrace(Trace.Verbose);
The received json rpc in the initialize request is
{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"processId": 33516,
"clientInfo": {
"name": "Visual Studio Code",
"version": "1.91.0"
},
"locale": "en",
// ...
"trace": "off", // <----
// ...
}
}
and in set trace notification
{
"jsonrpc":"2.0",
"method":"$/setTrace",
"params":{"value":"off"} // <----
}
Work around: When sending
client.sendNotification( SetTraceNotification.type.method, { value: Trace.Verbose } );
I first receive value=”off” and then a second message value=”verbose”. So two messages are emitted (always first “off” and second the user’s choice, could be “off” again, too), but nevertheless it changes to the correct value.
What is the trick to get setTrace
working and why is sendNotification
sending twice? Any hints?
Regards
Matt