Skip to content

Commit 25a213b

Browse files
committed
Rename [ICommand] to [RelayCommand]
1 parent 0267515 commit 25a213b

File tree

10 files changed

+166
-166
lines changed

10 files changed

+166
-166
lines changed

CommunityToolkit.Mvvm.SourceGenerators/AnalyzerReleases.Shipped.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ MVVMTK0003 | CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator |
1313
MVVMTK0004 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
1414
MVVMTK0005 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
1515
MVVMTK0006 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
16-
MVVMTK0007 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
16+
MVVMTK0007 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
1717
MVVMTK0008 | Microsoft.CodeAnalysis.CSharp.CSharpParseOptions | Error | See https://aka.ms/mvvmtoolkit/error
18-
MVVMTK0009 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
19-
MVVMTK0010 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
20-
MVVMTK0011 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
21-
MVVMTK0012 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
22-
MVVMTK0013 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
18+
MVVMTK0009 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
19+
MVVMTK0010 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
20+
MVVMTK0011 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
21+
MVVMTK0012 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
22+
MVVMTK0013 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
2323
MVVMTK0014 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
2424
MVVMTK0015 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
2525
MVVMTK0016 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
@@ -29,8 +29,8 @@ MVVMTK0019 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator
2929
MVVMTK0020 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3030
MVVMTK0021 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3131
MVVMTK0022 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
32-
MVVMTK0023 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
33-
MVVMTK0024 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
32+
MVVMTK0023 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
33+
MVVMTK0024 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3434
MVVMTK0025 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3535
MVVMTK0026 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3636
MVVMTK0027 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error

CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/ObservablePropertyGenerator.Execute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ bool IsCommandNameValidWithGeneratedMembers(string commandName)
380380
foreach (ISymbol member in fieldSymbol.ContainingType.GetAllMembers())
381381
{
382382
if (member is IMethodSymbol methodSymbol &&
383-
methodSymbol.HasAttributeWithFullyQualifiedName("global::CommunityToolkit.Mvvm.Input.ICommandAttribute") &&
384-
commandName == ICommandGenerator.Execute.GetGeneratedFieldAndPropertyNames(methodSymbol).PropertyName)
383+
methodSymbol.HasAttributeWithFullyQualifiedName("global::CommunityToolkit.Mvvm.Input.RelayCommandAttribute") &&
384+
commandName == RelayCommandGenerator.Execute.GetGeneratedFieldAndPropertyNames(methodSymbol).PropertyName)
385385
{
386386
return true;
387387
}

CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ internal static class DiagnosticDescriptors
117117
/// Format: <c>"The method {0}.{1} cannot be used to generate a command property, as its signature isn't compatible with any of the existing relay command types"</c>.
118118
/// </para>
119119
/// </summary>
120-
public static readonly DiagnosticDescriptor InvalidICommandMethodSignatureError = new DiagnosticDescriptor(
120+
public static readonly DiagnosticDescriptor InvalidRelayCommandMethodSignatureError = new DiagnosticDescriptor(
121121
id: "MVVMTK0007",
122-
title: "Invalid ICommand method signature",
122+
title: "Invalid RelayCommand method signature",
123123
messageFormat: "The method {0}.{1} cannot be used to generate a command property, as its signature isn't compatible with any of the existing relay command types",
124-
category: typeof(ICommandGenerator).FullName,
124+
category: typeof(RelayCommandGenerator).FullName,
125125
defaultSeverity: DiagnosticSeverity.Error,
126126
isEnabledByDefault: true,
127-
description: "Cannot apply [ICommand] to methods with a signature that doesn't match any of the existing relay command types.",
127+
description: "Cannot apply [RelayCommand] to methods with a signature that doesn't match any of the existing relay command types.",
128128
helpLinkUri: "https://aka.ms/mvvmtoolkit");
129129

130130
/// <summary>
@@ -148,12 +148,12 @@ internal static class DiagnosticDescriptors
148148
/// </summary>
149149
public static readonly DiagnosticDescriptor InvalidCanExecuteMemberNameError = new DiagnosticDescriptor(
150150
id: "MVVMTK0009",
151-
title: "Invalid ICommand.CanExecute member name",
151+
title: "Invalid RelayCommand.CanExecute member name",
152152
messageFormat: "The CanExecute name must refer to a valid member, but \"{0}\" has no matches in type {1}",
153-
category: typeof(ICommandGenerator).FullName,
153+
category: typeof(RelayCommandGenerator).FullName,
154154
defaultSeverity: DiagnosticSeverity.Error,
155155
isEnabledByDefault: true,
156-
description: "The CanExecute name in [ICommand] must refer to a valid member in its parent type.",
156+
description: "The CanExecute name in [RelayCommand] must refer to a valid member in its parent type.",
157157
helpLinkUri: "https://aka.ms/mvvmtoolkit");
158158

159159
/// <summary>
@@ -164,12 +164,12 @@ internal static class DiagnosticDescriptors
164164
/// </summary>
165165
public static readonly DiagnosticDescriptor MultipleCanExecuteMemberNameMatchesError = new DiagnosticDescriptor(
166166
id: "MVVMTK0010",
167-
title: "Multiple ICommand.CanExecute member name matches",
167+
title: "Multiple RelayCommand.CanExecute member name matches",
168168
messageFormat: "The CanExecute name must refer to a single member, but \"{0}\" has multiple matches in type {1}",
169-
category: typeof(ICommandGenerator).FullName,
169+
category: typeof(RelayCommandGenerator).FullName,
170170
defaultSeverity: DiagnosticSeverity.Error,
171171
isEnabledByDefault: true,
172-
description: "Cannot set the CanExecute name in [ICommand] to one that has multiple matches in its parent type (it must refer to a single compatible member).",
172+
description: "Cannot set the CanExecute name in [RelayCommand] to one that has multiple matches in its parent type (it must refer to a single compatible member).",
173173
helpLinkUri: "https://aka.ms/mvvmtoolkit");
174174

175175
/// <summary>
@@ -180,44 +180,44 @@ internal static class DiagnosticDescriptors
180180
/// </summary>
181181
public static readonly DiagnosticDescriptor InvalidCanExecuteMemberError = new DiagnosticDescriptor(
182182
id: "MVVMTK0011",
183-
title: "No valid ICommand.CanExecute member match",
183+
title: "No valid RelayCommand.CanExecute member match",
184184
messageFormat: "The CanExecute name must refer to a compatible member, but no valid members were found for \"{0}\" in type {1}",
185-
category: typeof(ICommandGenerator).FullName,
185+
category: typeof(RelayCommandGenerator).FullName,
186186
defaultSeverity: DiagnosticSeverity.Error,
187187
isEnabledByDefault: true,
188-
description: "The CanExecute name in [ICommand] must refer to a compatible member (either a property or a method) to be used in a generated command.",
188+
description: "The CanExecute name in [RelayCommand] must refer to a compatible member (either a property or a method) to be used in a generated command.",
189189
helpLinkUri: "https://aka.ms/mvvmtoolkit");
190190

191191
/// <summary>
192-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>ICommandAttribute.AllowConcurrentExecutions</c> is being set for a non-asynchronous method.
192+
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>RelayCommandAttribute.AllowConcurrentExecutions</c> is being set for a non-asynchronous method.
193193
/// <para>
194-
/// Format: <c>"The method {0}.{1} cannot be annotated with the [ICommand] attribute specifying a concurrency control setting, as it maps to a non-asynchronous command type"</c>.
194+
/// Format: <c>"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying a concurrency control setting, as it maps to a non-asynchronous command type"</c>.
195195
/// </para>
196196
/// </summary>
197197
public static readonly DiagnosticDescriptor InvalidConcurrentExecutionsParameterError = new DiagnosticDescriptor(
198198
id: "MVVMTK0012",
199199
title: "Invalid concurrency control setting usage",
200-
messageFormat: "The method {0}.{1} cannot be annotated with the [ICommand] attribute specifying a concurrency control setting, as it maps to a non-asynchronous command type",
201-
category: typeof(ICommandGenerator).FullName,
200+
messageFormat: "The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying a concurrency control setting, as it maps to a non-asynchronous command type",
201+
category: typeof(RelayCommandGenerator).FullName,
202202
defaultSeverity: DiagnosticSeverity.Error,
203203
isEnabledByDefault: true,
204-
description: "Cannot apply the [ICommand] attribute specifying a concurrency control setting to methods mapping to non-asynchronous command types.",
204+
description: "Cannot apply the [RelayCommand] attribute specifying a concurrency control setting to methods mapping to non-asynchronous command types.",
205205
helpLinkUri: "https://aka.ms/mvvmtoolkit");
206206

207207
/// <summary>
208-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>ICommandAttribute.IncludeCancelCommandParameter</c> is being set for an invalid method.
208+
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>RelayCommandAttribute.IncludeCancelCommandParameter</c> is being set for an invalid method.
209209
/// <para>
210-
/// Format: <c>"The method {0}.{1} cannot be annotated with the [ICommand] attribute specifying to include a cancel command, as it does not map to an asynchronous command type taking a cancellation token"</c>.
210+
/// Format: <c>"The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying to include a cancel command, as it does not map to an asynchronous command type taking a cancellation token"</c>.
211211
/// </para>
212212
/// </summary>
213213
public static readonly DiagnosticDescriptor InvalidIncludeCancelCommandParameterError = new DiagnosticDescriptor(
214214
id: "MVVMTK0013",
215215
title: "Invalid include cancel command setting usage",
216-
messageFormat: "The method {0}.{1} cannot be annotated with the [ICommand] attribute specifying to include a cancel command, as it does not map to an asynchronous command type taking a cancellation token",
217-
category: typeof(ICommandGenerator).FullName,
216+
messageFormat: "The method {0}.{1} cannot be annotated with the [RelayCommand] attribute specifying to include a cancel command, as it does not map to an asynchronous command type taking a cancellation token",
217+
category: typeof(RelayCommandGenerator).FullName,
218218
defaultSeverity: DiagnosticSeverity.Error,
219219
isEnabledByDefault: true,
220-
description: "Cannot apply the [ICommand] attribute specifying to include a cancel command to methods not mapping to an asynchronous command type accepting a cancellation token.",
220+
description: "Cannot apply the [RelayCommand] attribute specifying to include a cancel command to methods not mapping to an asynchronous command type accepting a cancellation token.",
221221
helpLinkUri: "https://aka.ms/mvvmtoolkit");
222222

223223
/// <summary>
@@ -365,19 +365,19 @@ internal static class DiagnosticDescriptors
365365
helpLinkUri: "https://aka.ms/mvvmtoolkit");
366366

367367
/// <summary>
368-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when a specified <c>[ICommand]</c> method has any overloads.
368+
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when a specified <c>[RelayCommand]</c> method has any overloads.
369369
/// <para>
370370
/// Format: <c>"The CanExecute name must refer to a single member, but "{0}" has multiple matches in type {1}"</c>.
371371
/// </para>
372372
/// </summary>
373-
public static readonly DiagnosticDescriptor MultipleICommandMethodOverloadsError = new DiagnosticDescriptor(
373+
public static readonly DiagnosticDescriptor MultipleRelayCommandMethodOverloadsError = new DiagnosticDescriptor(
374374
id: "MVVMTK0023",
375-
title: "Multiple overloads for method annotated with ICommand",
376-
messageFormat: "The method {0}.{1} cannot be annotated with [ICommand], has it has multiple overloads (command methods must be unique within their containing type)",
377-
category: typeof(ICommandGenerator).FullName,
375+
title: "Multiple overloads for method annotated with RelayCommand",
376+
messageFormat: "The method {0}.{1} cannot be annotated with [RelayCommand], has it has multiple overloads (command methods must be unique within their containing type)",
377+
category: typeof(RelayCommandGenerator).FullName,
378378
defaultSeverity: DiagnosticSeverity.Error,
379379
isEnabledByDefault: true,
380-
description: "Methods with multiple overloads cannot be annotated with [ICommand], as command methods must be unique within their containing type.",
380+
description: "Methods with multiple overloads cannot be annotated with [RelayCommand], as command methods must be unique within their containing type.",
381381
helpLinkUri: "https://aka.ms/mvvmtoolkit");
382382

383383
/// <summary>

0 commit comments

Comments
 (0)