Open bzoracler opened 3 weeks ago
Indeed that's strange. Is there any chance that you investigate more the problem?
The problem is in com.redhat.devtools.lsp4ij.console.explorer.TracingMessageConsumer
, in the locations where it calls MessageJsonHandler.toString(...)
.
org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler#toString
uses a default Gson
instance which doesn't serialise null
s.
I made a temporary patch using a Gson
instance which turns on null
serialisation, and the null
s started appearing in the traces.
For configuration I undestand that it is better to see null fields, but for other lsp request responses message like completion , showing null fields are not interesting, will grow up the lsp message in the console which will polluate the lsp console.
I'm setting configurations through the user-defined language server UI, and find that properties with values explicitly set as
null
are being stripped before the server receives them:When I use the server to request the options/settings from the client, the fields which were set to
null
are now simply missing.I expect preservation of fields set to
null
when sent from the client to the server1. The configuration object that's being retrieved from the UI2 shows thatnull
is actually present in the client configuration object before being sent to the server, so something must be happening after reading the configuration.According to the language server specification, the types of
initializationOptions
and return value of configuration requests are bothLSPAny
, which is a type union includingLSPObject
andnull
.LSPObject
is defined as:So,
LSPObject
s are allowed to havestring
keys andnull
values.Using the following modification of
com.redhat.devtools.lsp4ij.server.definition.launching.UserDefinedLanguageServerDefinition
:IDE Logs: