OmniSharp/csharp-language-server-protocol

Serialization issue with 0.19.8 update

andyleejordan opened this issue · 4 comments

Hi there @david-driscoll et. al.,

I'm attempting to update the PowerShell extension's server to 0.19.8, and managed to get it building again in PowerShell/PowerShellEditorServices#2079, but per the last commit in that PR I can't get the server to initialize as there's a serialization error:

[Error - 4:53:23 PM] OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request initialize 0 - Newtonsoft.Json.JsonSerializationException: Error converting value True to type 'OmniSharp.Extensions.LanguageServer.Protocol.Supports`1[OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.SemanticTokensCapabilityRequestRange]'. Path 'textDocument.semanticTokens.requests.range', line 1, position 4679.

 ---> System.ArgumentException: Could not cast or convert from System.Boolean to OmniSharp.Extensions.LanguageServer.Protocol.Supports`1[OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities.SemanticTokensCapabilityRequestRange].

That Range type is BooleanOr<SemanticTokensCapabilityRequestRange> so like, true should work. I also tried new SemanticTokensCapabilityRequestRange() { } per what I saw in David's code here: https://github.com/david-driscoll/dotnet-conf-2020/blob/1a73d216cc179aaf516900e5259ab3a106b3fd6d/server/TokenProvider.cs#L33

That still didn't work, so I think it's complaining about a boolean coming over the wire from the client...butI can't find anything client-side to change, and even if I did, shouldn't it work with true like it has in the past given that BooleanOr type?

I'm experiencing the same issue after the upgrade...

Well glad to know it's not just me!

This issue should be resolved by #1025 and the fix is in the 0.19.9 release.

Confirmed resolved, thanks @JoeRobich!