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

Opt into stj serialization on LSPclient #72675

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,6 +18,7 @@
using Microsoft.VisualStudio.Composition;
using Microsoft.VisualStudio.LanguageServer.Client;
using Microsoft.VisualStudio.Threading;
using Microsoft.VisualStudio.Utilities;
using Nerdbank.Streams;
using Roslyn.LanguageServer.Protocol;
using StreamJsonRpc;
Expand All @@ -30,7 +31,7 @@ internal abstract partial class AbstractInProcLanguageClient(
ILspServiceLoggerFactory lspLoggerFactory,
IThreadingContext threadingContext,
ExportProvider exportProvider,
AbstractLanguageClientMiddleLayer? middleLayer = null) : ILanguageClient, ILanguageServerFactory, ICapabilitiesProvider, ILanguageClientCustomMessage2
AbstractLanguageClientMiddleLayer? middleLayer = null) : ILanguageClient, ILanguageServerFactory, ICapabilitiesProvider, ILanguageClientCustomMessage2, IPropertyOwner
{
private readonly IThreadingContext _threadingContext = threadingContext;
private readonly ILanguageClientMiddleLayer? _middleLayer = middleLayer;
Expand Down Expand Up @@ -99,6 +100,8 @@ internal abstract partial class AbstractInProcLanguageClient(
/// </summary>
public IEnumerable<string>? FilesToWatch { get; }

public PropertyCollection Properties { get; } = CreateStjPropertyCollection();

public event AsyncEventHandler<EventArgs>? StartAsync;

/// <summary>
Expand Down Expand Up @@ -257,6 +260,13 @@ public Task OnServerInitializedAsync()
/// </summary>
public Task AttachForCustomMessageAsync(JsonRpc rpc) => Task.CompletedTask;

private static PropertyCollection CreateStjPropertyCollection()
{
var collection = new PropertyCollection();
collection.AddProperty("lsp-serialization", "stj");
return collection;
}

internal TestAccessor GetTestAccessor()
{
return new TestAccessor(this);
Expand Down