Skip to content

Commit d3424db

Browse files
committed
Remove RUC/RDC attributes where they are no longer needed
1 parent 5769656 commit d3424db

15 files changed

+12
-49
lines changed

src/Microsoft.ServiceHub.Framework/Container/GlobalBrokeredServiceContainer.ProfferedRemoteServiceBroker.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ public partial class GlobalBrokeredServiceContainer
1717
/// Services a brokered service that is proffered via a <see cref="IRemoteServiceBroker"/>.
1818
/// </summary>
1919
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + "}")]
20-
[RequiresUnreferencedCode(Reasons.Formatters)]
21-
[RequiresDynamicCode(Reasons.Formatters)]
2220
protected class ProfferedRemoteServiceBroker : IProffered
2321
{
2422
private readonly GlobalBrokeredServiceContainer container;
2523
private readonly AsyncLazy<IServiceBroker> serviceBroker;
2624

25+
[RequiresUnreferencedCode(Reasons.TypeLoad)]
2726
internal ProfferedRemoteServiceBroker(GlobalBrokeredServiceContainer container, IRemoteServiceBroker remoteServiceBroker, MultiplexingStream? multiplexingStream, ServiceSource source, IReadOnlyCollection<ServiceMoniker> serviceMonikers)
2827
{
2928
this.container = container ?? throw new ArgumentNullException(nameof(container));

src/Microsoft.ServiceHub.Framework/Container/GlobalBrokeredServiceContainer.ProfferedServiceFactory.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ public abstract partial class GlobalBrokeredServiceContainer
1717
/// Services a brokered service that is proffered via an in-proc factory.
1818
/// </summary>
1919
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + "}")]
20-
[RequiresUnreferencedCode(Reasons.Formatters)]
21-
[RequiresDynamicCode(Reasons.Formatters)]
20+
[RequiresUnreferencedCode(Reasons.TypeLoad)]
2221
protected class ProfferedServiceFactory : IProffered
2322
{
2423
private static readonly ProtectedOperation ClientIsOwnerProtectedOperation = WellKnownProtectedOperations.CreateClientIsOwner();

src/Microsoft.ServiceHub.Framework/Container/GlobalBrokeredServiceContainer.ProfferedViewIntrinsicService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public abstract partial class GlobalBrokeredServiceContainer
3030
/// Services a brokered service that is proffered via an in-proc factory.
3131
/// </summary>
3232
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + "}")]
33-
[RequiresUnreferencedCode(Reasons.Formatters)]
34-
[RequiresDynamicCode(Reasons.Formatters)]
33+
[RequiresUnreferencedCode(Reasons.TypeLoad)]
3534
protected class ProfferedViewIntrinsicService : ProfferedServiceFactory
3635
{
3736
private readonly ViewIntrinsicBrokeredServiceFactory factory;

src/Microsoft.ServiceHub.Framework/Container/GlobalBrokeredServiceContainer.View.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public abstract partial class GlobalBrokeredServiceContainer
1717
/// A filtered view on the services proffered to a <see cref="GlobalBrokeredServiceContainer"/>, exposed as an <see cref="IServiceBroker"/>.
1818
/// </summary>
1919
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + "}")]
20+
[RequiresUnreferencedCode(Reasons.TypeLoad)]
2021
protected class View : IServiceBroker, IRemoteServiceBroker
2122
{
2223
/// <summary>

src/Microsoft.ServiceHub.Framework/Container/GlobalBrokeredServiceContainer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ namespace Microsoft.VisualStudio.Utilities.ServiceBroker;
2121
/// <remarks>
2222
/// <para>When a service is registered without a version, it doubles as a fallback service when a request for that service name is made but no exact version match can be found.</para>
2323
/// </remarks>
24-
[RequiresUnreferencedCode(Reasons.Formatters)]
25-
[RequiresDynamicCode(Reasons.Formatters)]
24+
[RequiresUnreferencedCode(Reasons.TypeLoad)]
2625
public abstract partial class GlobalBrokeredServiceContainer : IBrokeredServiceContainer, IBrokeredServiceContainerInternal, IBrokeredServiceContainerDiagnostics
2726
{
2827
/// <summary>

src/Microsoft.ServiceHub.Framework/Container/IMissingServiceDiagnosticsService.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using Microsoft.ServiceHub.Framework;
5+
using PolyType;
6+
using StreamJsonRpc;
57

68
namespace Microsoft.VisualStudio.Utilities.ServiceBroker;
79

810
/// <summary>
911
/// Provides diagnostics to understand why brokered services are not activatable.
1012
/// </summary>
11-
public interface IMissingServiceDiagnosticsService
13+
[GenerateShape(IncludeMethods = MethodShapeFlags.PublicInstance)]
14+
[JsonRpcContract]
15+
public partial interface IMissingServiceDiagnosticsService
1216
{
1317
/// <summary>
1418
/// Analyzes possible explanations for why a brokered service could not be acquired.

src/Microsoft.ServiceHub.Framework/Container/ServiceBrokerOfExportedServices.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ namespace Microsoft.VisualStudio.Shell.ServiceBroker;
2121
/// At startup, the IDE should acquire this export and call <see cref="RegisterAndProfferServicesAsync(System.Threading.CancellationToken)"/>
2222
/// to add MEF exported brokered services to the container.
2323
/// </remarks>
24-
[RequiresUnreferencedCode(Reasons.Formatters)]
25-
[RequiresDynamicCode(Reasons.Formatters)]
2624
public abstract class ServiceBrokerOfExportedServices : IServiceBroker
2725
{
2826
private static readonly ProtectedOperation ClientIsOwnerProtectedOperation = WellKnownProtectedOperations.CreateClientIsOwner();
@@ -248,8 +246,6 @@ private static ServiceMoniker CreateServiceMoniker(IBrokeredServicesExportMetada
248246
/// <param name="serviceActivationOptions">The activation options to use with this service.</param>
249247
/// <param name="cancellationToken">A cancellation token.</param>
250248
/// <returns>The MEF export representing this sharing boundary.</returns>
251-
[RequiresUnreferencedCode(Reasons.Formatters)]
252-
[RequiresDynamicCode(Reasons.Formatters)]
253249
private async ValueTask<Export<ServiceBrokerForExportedBrokeredServices>?> ActivateBrokeredServiceAsync(ServiceMoniker serviceMoniker, IServiceBroker contextualServiceBroker, ServiceActivationOptions serviceActivationOptions, CancellationToken cancellationToken)
254250
{
255251
Export<ServiceBrokerForExportedBrokeredServices> sb = this.ServiceBrokerFactory.CreateExport();

src/Microsoft.ServiceHub.Framework/DelegatingServiceJsonRpcPolyTypeDescriptor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ namespace Microsoft.ServiceHub.Framework;
2222
/// </para>
2323
/// </remarks>
2424
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")]
25-
[RequiresDynamicCode(Reasons.Formatters)]
26-
[RequiresUnreferencedCode(Reasons.Formatters)]
2725
public abstract class DelegatingServiceJsonRpcPolyTypeDescriptor : ServiceJsonRpcPolyTypeDescriptor
2826
{
2927
private ServiceJsonRpcPolyTypeDescriptor innerDescriptor;

src/Microsoft.ServiceHub.Framework/Extensions/ServiceManagerReflectionHelpers.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ internal static class ServiceManagerReflectionHelpers
2525
/// This is called via reflection from Microsoft.ServiceHub.HostStub.ServiceManager.GetServiceBrokerFromServiceActivationOptionsAsync so that the
2626
/// <see cref="IServiceBroker"/> can be passed directly to the constructor of a ServiceHub service.
2727
/// </devremarks>
28-
[RequiresUnreferencedCode(Reasons.Formatters)]
29-
[RequiresDynamicCode(Reasons.Formatters)]
28+
[RequiresUnreferencedCode(Reasons.TypeLoad)]
3029
internal static async Task<IServiceBroker?> GetServiceBrokerAsync(ServiceActivationOptions options, CancellationToken cancellationToken)
3130
{
3231
string serverPipeName = options.GetServiceBrokerServerPipeName();
@@ -54,8 +53,6 @@ internal static class ServiceManagerReflectionHelpers
5453
/// This called via reflection from Microsoft.ServiceHub.HostStub.ServiceManager.GetServiceFactoryCreateAsyncArguments so that an
5554
/// <see cref="AuthorizationServiceClient"/> can be passed directly to the constructor of a ServiceHub service.
5655
/// </devremarks>
57-
[RequiresUnreferencedCode(Reasons.Formatters)]
58-
[RequiresDynamicCode(Reasons.Formatters)]
5956
internal static Task<AuthorizationServiceClient> GetAuthorizationServiceClientAsync(IServiceBroker broker, CancellationToken cancellationToken) =>
6057
Task.FromResult(new AuthorizationServiceClient(new LazyAuthorizationServiceProxy(broker, joinableTaskFactory: null), ownsAuthorizationService: true));
6158

src/Microsoft.ServiceHub.Framework/FrameworkServices.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ namespace Microsoft.ServiceHub.Framework;
1616
/// <summary>
1717
/// Services and service contracts that provide core infrastructure.
1818
/// </summary>
19-
[RequiresUnreferencedCode(Reasons.Formatters)]
20-
[RequiresDynamicCode(Reasons.Formatters)]
2119
public static partial class FrameworkServices
2220
{
2321
/// <summary>
@@ -62,8 +60,6 @@ public static partial class FrameworkServices
6260
/// A <see cref="ServiceJsonRpcPolyTypeDescriptor"/> derived type that applies camelCase naming transforms to method and event names
6361
/// and trims off any trailing "Async" suffix.
6462
/// </summary>
65-
[RequiresUnreferencedCode(Reasons.Formatters)]
66-
[RequiresDynamicCode(Reasons.Formatters)]
6763
private class CamelCaseTransformingDescriptor : ServiceJsonRpcPolyTypeDescriptor
6864
{
6965
private const string AsyncSuffix = "Async";

0 commit comments

Comments
 (0)