Skip to content

Commit

Permalink
Merge pull request #3 from chabiss/dev/bretjohn/update-to-protocol-v3
Browse files Browse the repository at this point in the history
Update protocol to v3 for MauiLaunchCustomizer brokered service
  • Loading branch information
BretJohnson authored Mar 25, 2024
2 parents 7fb10cd + 3ac0c7a commit c1e2927
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Workspaces/Remote/Core/BrokeredServiceDescriptors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using Microsoft.ServiceHub.Framework;
using Nerdbank.Streams;
using StreamJsonRpc;
using static Microsoft.ServiceHub.Framework.ServiceJsonRpcDescriptor;

Expand Down Expand Up @@ -73,7 +74,7 @@ protected override JsonRpcConnection CreateConnection(JsonRpc jsonRpc)
public static readonly ServiceRpcDescriptor HotReloadLoggerService = CreateDebuggerServiceDescriptor("HotReloadLogger", new Version(0, 1));
public static readonly ServiceRpcDescriptor HotReloadSessionNotificationService = CreateDebuggerServiceDescriptor("HotReloadSessionNotificationService", new Version(0, 1));
public static readonly ServiceRpcDescriptor ManagedHotReloadAgentManagerService = CreateDebuggerServiceDescriptor("ManagedHotReloadAgentManagerService", new Version(0, 1));
public static readonly ServiceRpcDescriptor MauiLaunchCustomizerServiceDescriptor = CreateMauiClientServiceDescriptor("MauiLaunchCustomizerService", new Version(0, 1));
public static readonly ServiceRpcDescriptor MauiLaunchCustomizerServiceDescriptor = CreateMauiServiceDescriptor("MauiLaunchCustomizerService", new Version(0, 1));

public static ServiceMoniker CreateMoniker(string namespaceName, string componentName, string serviceName, Version? version)
=> new(namespaceName + "." + componentName + "." + serviceName, version);
Expand All @@ -98,10 +99,12 @@ public static ServiceJsonRpcDescriptor CreateDebuggerServiceDescriptor(string se
=> CreateDescriptor(CreateMoniker(VisualStudioComponentNamespace, DebuggerComponentName, serviceName, version));

/// <summary>
/// Descriptor for services proferred by the MAUI client extension (implemented in TypeScript).
/// Descriptor for services proferred by the MAUI extension (implemented in TypeScript).
/// </summary>
public static ServiceJsonRpcDescriptor CreateMauiClientServiceDescriptor(string serviceName, Version? version)
=> new ClientServiceDescriptor(CreateMoniker(VisualStudioComponentNamespace, "Maui", serviceName, version), clientInterface: null)
public static ServiceJsonRpcDescriptor CreateMauiServiceDescriptor(string serviceName, Version? version)
=> new ServiceJsonRpcDescriptor(CreateMoniker(VisualStudioComponentNamespace, "Maui", serviceName, version), clientInterface: null,
Formatters.MessagePack, MessageDelimiters.BigEndianInt32LengthHeader,
new MultiplexingStream.Options { ProtocolMajorVersion = 3 })
.WithExceptionStrategy(ExceptionProcessing.ISerializable);

private static ServiceJsonRpcDescriptor CreateDescriptor(ServiceMoniker moniker)
Expand Down

0 comments on commit c1e2927

Please sign in to comment.