11
11
12
12
namespace Microsoft . AspNetCore . SignalR . Client . SourceGenerator ;
13
13
14
- internal partial class HubClientProxyGenerator
14
+ internal partial class ClientHubGenerator
15
15
{
16
16
public class Parser
17
17
{
@@ -21,7 +21,7 @@ internal static bool IsSyntaxTargetForAttribute(SyntaxNode node) => node is Attr
21
21
{
22
22
Identifier :
23
23
{
24
- Text : "HubClientProxy "
24
+ Text : "ClientHub "
25
25
}
26
26
} ,
27
27
Parent :
@@ -39,7 +39,7 @@ internal static bool IsSyntaxTargetForAttribute(SyntaxNode node) => node is Attr
39
39
var attributeSymbol = ModelExtensions . GetSymbolInfo ( context . SemanticModel , attributeSyntax ) . Symbol ;
40
40
41
41
if ( attributeSymbol is null ||
42
- ! attributeSymbol . ToString ( ) . EndsWith ( "HubClientProxyAttribute ()" , StringComparison . Ordinal ) )
42
+ ! attributeSymbol . ToString ( ) . EndsWith ( "ClientHubAttribute ()" , StringComparison . Ordinal ) )
43
43
{
44
44
return null ;
45
45
}
@@ -53,7 +53,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
53
53
if ( ! symbol . IsPartialDefinition )
54
54
{
55
55
context . ReportDiagnostic ( Diagnostic . Create (
56
- DiagnosticDescriptors . HubClientProxyAttributedMethodIsNotPartial ,
56
+ DiagnosticDescriptors . ClientHubAttributedMethodIsNotPartial ,
57
57
symbol . Locations [ 0 ] ) ) ;
58
58
return false ;
59
59
}
@@ -62,7 +62,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
62
62
if ( ! symbol . IsExtensionMethod )
63
63
{
64
64
context . ReportDiagnostic ( Diagnostic . Create (
65
- DiagnosticDescriptors . HubClientProxyAttributedMethodIsNotExtension ,
65
+ DiagnosticDescriptors . ClientHubAttributedMethodIsNotExtension ,
66
66
symbol . Locations [ 0 ] ) ) ;
67
67
return false ;
68
68
}
@@ -71,7 +71,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
71
71
if ( symbol . Arity != 1 )
72
72
{
73
73
context . ReportDiagnostic ( Diagnostic . Create (
74
- DiagnosticDescriptors . HubClientProxyAttributedMethodTypeArgCountIsBad ,
74
+ DiagnosticDescriptors . ClientHubAttributedMethodTypeArgCountIsBad ,
75
75
symbol . Locations [ 0 ] ) ) ;
76
76
return false ;
77
77
}
@@ -80,7 +80,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
80
80
if ( symbol . Parameters . Length != 2 )
81
81
{
82
82
context . ReportDiagnostic ( Diagnostic . Create (
83
- DiagnosticDescriptors . HubClientProxyAttributedMethodArgCountIsBad ,
83
+ DiagnosticDescriptors . ClientHubAttributedMethodArgCountIsBad ,
84
84
symbol . Locations [ 0 ] ) ) ;
85
85
return false ;
86
86
}
@@ -89,7 +89,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
89
89
if ( ! SymbolEqualityComparer . Default . Equals ( symbol . TypeArguments [ 0 ] , symbol . Parameters [ 1 ] . Type ) )
90
90
{
91
91
context . ReportDiagnostic ( Diagnostic . Create (
92
- DiagnosticDescriptors . HubClientProxyAttributedMethodTypeArgAndProviderTypeDoesNotMatch ,
92
+ DiagnosticDescriptors . ClientHubAttributedMethodTypeArgAndProviderTypeDoesNotMatch ,
93
93
symbol . Locations [ 0 ] ) ) ;
94
94
return false ;
95
95
}
@@ -98,7 +98,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
98
98
if ( symbol . ReturnType . ToString ( ) != "System.IDisposable" )
99
99
{
100
100
context . ReportDiagnostic ( Diagnostic . Create (
101
- DiagnosticDescriptors . HubClientProxyAttributedMethodHasBadReturnType ,
101
+ DiagnosticDescriptors . ClientHubAttributedMethodHasBadReturnType ,
102
102
symbol . Locations [ 0 ] ) ) ;
103
103
return false ;
104
104
}
@@ -107,7 +107,7 @@ private static bool IsExtensionMethodSignatureValid(IMethodSymbol symbol, Source
107
107
if ( hubConnectionSymbol . ToString ( ) != "Microsoft.AspNetCore.SignalR.Client.HubConnection" )
108
108
{
109
109
context . ReportDiagnostic ( Diagnostic . Create (
110
- DiagnosticDescriptors . HubClientProxyAttributedMethodArgIsNotHubConnection ,
110
+ DiagnosticDescriptors . ClientHubAttributedMethodArgIsNotHubConnection ,
111
111
symbol . Locations [ 0 ] ) ) ;
112
112
return false ;
113
113
}
@@ -160,7 +160,7 @@ internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is Mem
160
160
foreach ( var attributeData in methodSymbol . GetAttributes ( ) )
161
161
{
162
162
if ( ! attributeData . AttributeClass . ToString ( )
163
- . EndsWith ( "HubClientProxyAttribute " , StringComparison . Ordinal ) )
163
+ . EndsWith ( "ClientHubAttribute " , StringComparison . Ordinal ) )
164
164
{
165
165
continue ;
166
166
}
@@ -195,7 +195,7 @@ internal SourceGenerationSpec Parse(ImmutableArray<MethodDeclarationSyntax> meth
195
195
{
196
196
_context . ReportDiagnostic (
197
197
Diagnostic . Create (
198
- DiagnosticDescriptors . TooManyHubClientProxyAttributedMethods ,
198
+ DiagnosticDescriptors . TooManyClientHubAttributedMethods ,
199
199
extraneous . GetLocation ( ) ) ) ;
200
200
}
201
201
@@ -226,7 +226,7 @@ internal SourceGenerationSpec Parse(ImmutableArray<MethodDeclarationSyntax> meth
226
226
if ( sourceGenerationSpec . SetterMethodAccessibility is null )
227
227
{
228
228
_context . ReportDiagnostic ( Diagnostic . Create (
229
- DiagnosticDescriptors . HubClientProxyAttributedMethodBadAccessibility ,
229
+ DiagnosticDescriptors . ClientHubAttributedMethodBadAccessibility ,
230
230
methodDeclarationSyntax . GetLocation ( ) ) ) ;
231
231
return sourceGenerationSpec ;
232
232
}
@@ -301,7 +301,7 @@ internal SourceGenerationSpec Parse(ImmutableArray<MethodDeclarationSyntax> meth
301
301
if ( ! ( member . ReturnsVoid || member . ReturnType is INamedTypeSymbol { Arity : 0 , Name : "Task" } ) )
302
302
{
303
303
_context . ReportDiagnostic ( Diagnostic . Create (
304
- DiagnosticDescriptors . HubClientProxyUnsupportedReturnType ,
304
+ DiagnosticDescriptors . ClientHubUnsupportedReturnType ,
305
305
typeSpec . CallSite ,
306
306
methodSpec . Name , member . ReturnType . Name ) ) ;
307
307
methodSpec . Support = SupportClassification . UnsupportedReturnType ;
0 commit comments