roslyn
roslyn copied to clipboard
Switch Roslyn protocol types to System.Text.Json serialization
Switches the Roslyn server to use System.Text.Json serialization for all LSP messages.
I suggest reviewing one commit at a time
- 60464713a64ad98779fcf59b44247e4c565381e1 is almost entirely mechanical find/replace of DataContract/DataMember/other newtonsoft attributes with the STJ version inside the Protocol/Protocol folder. I also copied the new converters https://devdiv.visualstudio.com/DevDiv/_git/VSLanguageServerClient/pullrequest/530064 (adjusted for style warnings).
- b292a51d13e020e350366ac305706367cd9db5c2 is the meat of the change - switching streamjsonrpc to use STJ and implementing STJ support in the roslyn language server. It also covers modifying custom Roslyn protocol types to use STJ attributes.
- 1a4c3f429fe13a2e928c800cebbf93154447095a - I apologize for this commit, its very unfortunate. Basically we have not opted the client side into STJ serialization, its still using newtonsoft (blocked on Razor transitioning to new APIs). This means that when we make document symbol LSP requests for document outline, we need to use newtonsoft compatible types, otherwise the client can't serialize it. Rather than 'poisoning' the rest of the roslyn protocol with newtonsoft attributes, I created duplicate types that we can delete as soon we as swtich to STJ on the client side. I also updated the tests to actually serialize using newtonsoft on the client side (server side still uses STJ).
- cade3884c639ffc7168d59335c8099f2adfebcd2 - small random cleanup
Tested C#/Razor/F#/TS in VS, document symbols in VS, and C#/Razor in VSCode.
TODO - PR validation in progress.
Any early numbers about it this improves anything?
blocked on https://github.com/microsoft/vs-streamjsonrpc/issues/1038 (found in test insertion)
Fixes https://github.com/dotnet/roslyn/issues/72867 or at least is related to that issue, if we consider that there are still Newtonsoft-based parts for razor compatibility
blocked on https://github.com/microsoft/vs-streamjsonrpc/issues/1038 (found in test insertion)
unblocked. Now pending investigation of method JIT regressions
Updated PR validation is here https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/550816 (internal only)
JIT regressions are approved, will merge as soon as CI completes.
Woohoo!