Skip to content

Commit db89aab

Browse files
committed
rename
1 parent 124229c commit db89aab

17 files changed

+140
-154
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
6+
namespace Microsoft.AspNetCore.SignalR.Client;
7+
8+
/// <summary>
9+
/// Provides information for generating strongly typed SignalR client callbacks.
10+
/// Place this attribute on a method with the following syntax:
11+
/// <code>
12+
/// public static partial IDisposable RegisterCallbacks&lt;T&gt;(this HubConnection connection, T proxy);
13+
/// </code>
14+
/// </summary>
15+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
16+
public sealed class ClientHubAttribute : Attribute
17+
{
18+
}

src/SignalR/clients/csharp/Client.SourceGenerator/src/HubProxyAttributes/HubClientProxyAttribute.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/SignalR/clients/csharp/Client.SourceGenerator/src/HubProxyAttributes/HubServerProxyAttribute.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Microsoft.AspNetCore.SignalR.Client.HubClientProxyAttribute
2-
Microsoft.AspNetCore.SignalR.Client.HubClientProxyAttribute.HubClientProxyAttribute() -> void
3-
Microsoft.AspNetCore.SignalR.Client.HubServerProxyAttribute
4-
Microsoft.AspNetCore.SignalR.Client.HubServerProxyAttribute.HubServerProxyAttribute() -> void
1+
Microsoft.AspNetCore.SignalR.Client.ClientHubAttribute
2+
Microsoft.AspNetCore.SignalR.Client.ClientHubAttribute.ClientHubAttribute() -> void
3+
Microsoft.AspNetCore.SignalR.Client.ServerHubProxyAttribute
4+
Microsoft.AspNetCore.SignalR.Client.ServerHubProxyAttribute.ServerHubProxyAttribute() -> void
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
6+
namespace Microsoft.AspNetCore.SignalR.Client;
7+
8+
/// <summary>
9+
/// Provides information for generating strongly typed SignalR server invocations from the client.
10+
/// Place this attribute on a method with the following syntax:
11+
/// <code>
12+
/// public static partial T GetProxy&lt;T&gt;(this HubConnection connection);
13+
/// </code>
14+
/// </summary>
15+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
16+
public sealed class ServerHubProxyAttribute : Attribute
17+
{
18+
}

src/SignalR/clients/csharp/Client.SourceGenerator/src/gen/HubClientProxyGenerator.Emitter.cs renamed to src/SignalR/clients/csharp/Client.SourceGenerator/src/gen/ClientHubGenerator.Emitter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Microsoft.AspNetCore.SignalR.Client.SourceGenerator;
99

10-
internal partial class HubClientProxyGenerator
10+
internal partial class ClientHubGenerator
1111
{
1212
public class Emitter
1313
{

src/SignalR/clients/csharp/Client.SourceGenerator/src/gen/HubClientProxyGenerator.Parser.cs renamed to src/SignalR/clients/csharp/Client.SourceGenerator/src/gen/ClientHubGenerator.Parser.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Microsoft.AspNetCore.SignalR.Client.SourceGenerator;
1313

14-
internal partial class HubClientProxyGenerator
14+
internal partial class ClientHubGenerator
1515
{
1616
public class Parser
1717
{
@@ -21,7 +21,7 @@ internal static bool IsSyntaxTargetForAttribute(SyntaxNode node) => node is Attr
2121
{
2222
Identifier:
2323
{
24-
Text: "HubClientProxy"
24+
Text: "ClientHub"
2525
}
2626
},
2727
Parent:
@@ -39,7 +39,7 @@ internal static bool IsSyntaxTargetForAttribute(SyntaxNode node) => node is Attr
3939
var attributeSymbol = ModelExtensions.GetSymbolInfo(context.SemanticModel, attributeSyntax).Symbol;
4040

4141
if (attributeSymbol is null ||
42-
!attributeSymbol.ToString().EndsWith("HubClientProxyAttribute()", StringComparison.Ordinal))
42+
!attributeSymbol.ToString().EndsWith("ClientHubAttribute()", StringComparison.Ordinal))
4343
{
4444
return null;
4545
}
@@ -53,7 +53,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
5353
if (!symbol.IsPartialDefinition)
5454
{
5555
context.ReportDiagnostic(Diagnostic.Create(
56-
DiagnosticDescriptors.HubClientProxyAttributedMethodIsNotPartial,
56+
DiagnosticDescriptors.ClientHubAttributedMethodIsNotPartial,
5757
symbol.Locations[0]));
5858
return false;
5959
}
@@ -62,7 +62,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
6262
if (!symbol.IsExtensionMethod)
6363
{
6464
context.ReportDiagnostic(Diagnostic.Create(
65-
DiagnosticDescriptors.HubClientProxyAttributedMethodIsNotExtension,
65+
DiagnosticDescriptors.ClientHubAttributedMethodIsNotExtension,
6666
symbol.Locations[0]));
6767
return false;
6868
}
@@ -71,7 +71,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
7171
if (symbol.Arity != 1)
7272
{
7373
context.ReportDiagnostic(Diagnostic.Create(
74-
DiagnosticDescriptors.HubClientProxyAttributedMethodTypeArgCountIsBad,
74+
DiagnosticDescriptors.ClientHubAttributedMethodTypeArgCountIsBad,
7575
symbol.Locations[0]));
7676
return false;
7777
}
@@ -80,7 +80,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
8080
if (symbol.Parameters.Length != 2)
8181
{
8282
context.ReportDiagnostic(Diagnostic.Create(
83-
DiagnosticDescriptors.HubClientProxyAttributedMethodArgCountIsBad,
83+
DiagnosticDescriptors.ClientHubAttributedMethodArgCountIsBad,
8484
symbol.Locations[0]));
8585
return false;
8686
}
@@ -89,7 +89,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
8989
if (!SymbolEqualityComparer.Default.Equals(symbol.TypeArguments[0], symbol.Parameters[1].Type))
9090
{
9191
context.ReportDiagnostic(Diagnostic.Create(
92-
DiagnosticDescriptors.HubClientProxyAttributedMethodTypeArgAndProviderTypeDoesNotMatch,
92+
DiagnosticDescriptors.ClientHubAttributedMethodTypeArgAndProviderTypeDoesNotMatch,
9393
symbol.Locations[0]));
9494
return false;
9595
}
@@ -98,7 +98,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
9898
if (symbol.ReturnType.ToString() != "System.IDisposable")
9999
{
100100
context.ReportDiagnostic(Diagnostic.Create(
101-
DiagnosticDescriptors.HubClientProxyAttributedMethodHasBadReturnType,
101+
DiagnosticDescriptors.ClientHubAttributedMethodHasBadReturnType,
102102
symbol.Locations[0]));
103103
return false;
104104
}
@@ -107,7 +107,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
107107
if (hubConnectionSymbol.ToString() != "Microsoft.AspNetCore.SignalR.Client.HubConnection")
108108
{
109109
context.ReportDiagnostic(Diagnostic.Create(
110-
DiagnosticDescriptors.HubClientProxyAttributedMethodArgIsNotHubConnection,
110+
DiagnosticDescriptors.ClientHubAttributedMethodArgIsNotHubConnection,
111111
symbol.Locations[0]));
112112
return false;
113113
}
@@ -160,7 +160,7 @@ internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is Mem
160160
foreach (var attributeData in methodSymbol.GetAttributes())
161161
{
162162
if (!attributeData.AttributeClass.ToString()
163-
.EndsWith("HubClientProxyAttribute", StringComparison.Ordinal))
163+
.EndsWith("ClientHubAttribute", StringComparison.Ordinal))
164164
{
165165
continue;
166166
}
@@ -195,7 +195,7 @@ internal SourceGenerationSpec Parse(ImmutableArray<MethodDeclarationSyntax> meth
195195
{
196196
_context.ReportDiagnostic(
197197
Diagnostic.Create(
198-
DiagnosticDescriptors.TooManyHubClientProxyAttributedMethods,
198+
DiagnosticDescriptors.TooManyClientHubAttributedMethods,
199199
extraneous.GetLocation()));
200200
}
201201

@@ -226,7 +226,7 @@ internal SourceGenerationSpec Parse(ImmutableArray<MethodDeclarationSyntax> meth
226226
if (sourceGenerationSpec.SetterMethodAccessibility is null)
227227
{
228228
_context.ReportDiagnostic(Diagnostic.Create(
229-
DiagnosticDescriptors.HubClientProxyAttributedMethodBadAccessibility,
229+
DiagnosticDescriptors.ClientHubAttributedMethodBadAccessibility,
230230
methodDeclarationSyntax.GetLocation()));
231231
return sourceGenerationSpec;
232232
}
@@ -301,7 +301,7 @@ internal SourceGenerationSpec Parse(ImmutableArray<MethodDeclarationSyntax> meth
301301
if (!(member.ReturnsVoid || member.ReturnType is INamedTypeSymbol { Arity: 0, Name: "Task" }))
302302
{
303303
_context.ReportDiagnostic(Diagnostic.Create(
304-
DiagnosticDescriptors.HubClientProxyUnsupportedReturnType,
304+
DiagnosticDescriptors.ClientHubUnsupportedReturnType,
305305
typeSpec.CallSite,
306306
methodSpec.Name, member.ReturnType.Name));
307307
methodSpec.Support = SupportClassification.UnsupportedReturnType;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.AspNetCore.SignalR.Client.SourceGenerator;
88

9-
internal partial class HubClientProxyGenerator
9+
internal partial class ClientHubGenerator
1010
{
1111
public class SourceGenerationSpec
1212
{

src/SignalR/clients/csharp/Client.SourceGenerator/src/gen/HubServerProxyGenerator.cs renamed to src/SignalR/clients/csharp/Client.SourceGenerator/src/gen/ClientHubGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Microsoft.AspNetCore.SignalR.Client.SourceGenerator;
99

1010
[Generator]
11-
internal partial class HubServerProxyGenerator : IIncrementalGenerator
11+
internal partial class ClientHubGenerator : IIncrementalGenerator
1212
{
1313
public void Initialize(IncrementalGeneratorInitializationContext context)
1414
{

0 commit comments

Comments
 (0)