Skip to content

Commit

Permalink
Merge pull request #73240 from BretJohnson/dev/bretjohn/include-more-…
Browse files Browse the repository at this point in the history
…brokered-services

Allow use of more Hot Reload brokered services by LSP (for VS Code)
  • Loading branch information
dibarbet committed Apr 29, 2024
2 parents fa64d90 + a0375ce commit 39b5d9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ internal class Descriptors
{ BrokeredServiceDescriptors.DebuggerManagedHotReloadService.Moniker, new ServiceRegistration(ServiceAudience.Local, null, allowGuestClients: false) },
{ BrokeredServiceDescriptors.HotReloadSessionNotificationService.Moniker, new ServiceRegistration(ServiceAudience.Local, null, allowGuestClients: false) },
{ BrokeredServiceDescriptors.ManagedHotReloadAgentManagerService.Moniker, new ServiceRegistration(ServiceAudience.Local, null, allowGuestClients: false) },
{ BrokeredServiceDescriptors.MauiLaunchCustomizerServiceDescriptor.Moniker, new ServiceRegistration(ServiceAudience.Local, null, allowGuestClients: false) },
{ BrokeredServiceDescriptors.HotReloadOptionService.Moniker, new ServiceRegistration(ServiceAudience.Local, null, allowGuestClients: false) },
{ BrokeredServiceDescriptors.HotReloadLoggerService.Moniker, new ServiceRegistration(ServiceAudience.Local, null, allowGuestClients: false) },
{ BrokeredServiceDescriptors.MauiLaunchCustomizerService.Moniker, new ServiceRegistration(ServiceAudience.Local, null, allowGuestClients: false) },
}.ToImmutableDictionary();

public static ServiceJsonRpcDescriptor CreateDescriptor(ServiceMoniker serviceMoniker) => new(
Expand Down
10 changes: 9 additions & 1 deletion src/Workspaces/Remote/Core/BrokeredServiceDescriptors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ 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 = CreateMauiServiceDescriptor("MauiLaunchCustomizerService", new Version(0, 1));
public static readonly ServiceRpcDescriptor HotReloadOptionService = CreateDebuggerClientServiceDescriptor("HotReloadOptionService", new Version(0, 1));
public static readonly ServiceRpcDescriptor MauiLaunchCustomizerService = 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,6 +99,13 @@ public static ServiceJsonRpcDescriptor CreateServerServiceDescriptor(string serv
public static ServiceJsonRpcDescriptor CreateDebuggerServiceDescriptor(string serviceName, Version? version = null)
=> CreateDescriptor(CreateMoniker(VisualStudioComponentNamespace, DebuggerComponentName, serviceName, version));

/// <summary>
/// Descriptor for services proferred by the debugger server (implemented in TypeScript).
/// </summary>
public static ServiceJsonRpcDescriptor CreateDebuggerClientServiceDescriptor(string serviceName, Version? version = null)
=> new ClientServiceDescriptor(CreateMoniker(VisualStudioComponentNamespace, DebuggerComponentName, serviceName, version), clientInterface: null)
.WithExceptionStrategy(ExceptionProcessing.ISerializable);

/// <summary>
/// Descriptor for services proferred by the MAUI extension (implemented in TypeScript).
/// </summary>
Expand Down

0 comments on commit 39b5d9d

Please sign in to comment.