Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to STJ for client side LSP serialization #74364

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

dibarbet
Copy link
Member

@dibarbet dibarbet commented Jul 12, 2024

@dibarbet dibarbet requested a review from a team as a code owner July 12, 2024 00:11
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 12, 2024
public override Task HandleNotificationAsync(string methodName, JsonElement methodParam, Func<JsonElement, Task> sendNotification)
{
// Razor only ever looks at the method name, so it is safe to pass null for all the Newtonsoft JToken params.
return _razorCSharpInterceptionMiddleLayer.HandleNotificationAsync(methodName, null!, null!);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

named parameters?

@@ -3,19 +3,20 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.VisualStudio.LanguageServer.Client;
using Newtonsoft.Json.Linq;

namespace Microsoft.CodeAnalysis.Editor.Implementation.LanguageClient;

#pragma warning disable CS0618 // Type or member is obsolete - blocked on Razor switching to new APIs for STJ - https://github.com/dotnet/roslyn/issues/73317
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Type or member is obsolete

Is this pragma or the NewtonSoft using still needed?

@@ -267,6 +268,13 @@ public Task OnServerInitializedAsync()
/// </summary>
public Task AttachForCustomMessageAsync(JsonRpc rpc) => Task.CompletedTask;

private static PropertyCollection CreateStjPropertyCollection()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the client will be opting into STJ by default in 17.12 Preview 1, at which point we can remove this. However we have additional changes, so we need to go in first with an explicit opt-in.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opt into client side STJ serialization
5 participants