You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LXTK serializes diagnostic markers in wrong format.
If you have code field in Diagnostic class with type Either which has its own serializer and deserializer inside lsp4j. You have to use EitherTypeAdapter if you want to work with them properly. My project uses this diagnostics and deserializer crashes if code field is present.
The text was updated successfully, but these errors were encountered:
Yep, exception occures when you try do deserialize diagnostic from marker
!MESSAGE Unexpected token BEGIN_OBJECT: expected STRING | NUMBER tokens.
!STACK 0
com.google.gson.JsonParseException: Unexpected token BEGIN_OBJECT: expected STRING | NUMBER tokens.
at org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.create(EitherTypeAdapter.java:196)
at org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.read(EitherTypeAdapter.java:172)
at org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.read(EitherTypeAdapter.java:40)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
at com.google.gson.Gson.fromJson(Gson.java:888)
at com.google.gson.Gson.fromJson(Gson.java:853)
at com.google.gson.Gson.fromJson(Gson.java:802)
at com.google.gson.Gson.fromJson(Gson.java:774)
LXTK serializes diagnostic markers in wrong format.
If you have
code
field inDiagnostic
class with typeEither
which has its own serializer and deserializer inside lsp4j. You have to useEitherTypeAdapter
if you want to work with them properly. My project uses this diagnostics and deserializer crashes ifcode
field is present.The text was updated successfully, but these errors were encountered: