You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -203,4 +203,20 @@ internal static class DiagnosticDescriptors
203
203
isEnabledByDefault:true,
204
204
description:"Cannot apply the [ICommand] attribute specifying a concurrency control setting to methods mapping to non-asynchronous command types.",
205
205
helpLinkUri:"https://aka.ms/mvvmtoolkit");
206
+
207
+
/// <summary>
208
+
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <c>ICommandAttribute.IncludeCancelCommandParameter</c> is being set for an invalid method.
209
+
/// <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>.
title:"Invalid concurrency control 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,
218
+
defaultSeverity:DiagnosticSeverity.Error,
219
+
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.",
.WithOpenBracketToken(Token(TriviaList(Comment($"/// <summary>The backing field for <see cref=\"{cancelCommandPropertyName}\"/>.</summary>")),SyntaxKind.OpenBracketToken,TriviaList())));
263
+
264
+
// Construct the generated property as follows (the explicit delegate cast is needed to avoid overload resolution conflicts):
265
+
//
266
+
// /// <summary>Gets an <see cref="global::System.Windows.Input.ICommand" instance that can be used to cancel <see cref="<COMMAND_PROPERTY_NAME>"/>.</summary>
$"/// <summary>Gets an <see cref=\"global::System.Windows.Input.ICommand\"/> instance that can be used to cancel <see cref=\"{commandInfo.PropertyName}\"/>.</summary>")),
/// <param name="commandInterfaceType">The command interface type name.</param>
256
335
/// <param name="commandClassType">The command class type name.</param>
257
336
/// <param name="delegateType">The delegate type name for the wrapped method.</param>
337
+
/// <param name="supportsCancellation">Indicates whether or not the resulting command supports cancellation.</param>
258
338
/// <param name="commandTypeArguments">The type arguments for <paramref name="commandInterfaceType"/> and <paramref name="commandClassType"/>, if any.</param>
259
339
/// <param name="delegateTypeArguments">The type arguments for <paramref name="delegateType"/>, if any.</param>
260
340
/// <returns>Whether or not <paramref name="methodSymbol"/> was valid and the requested types have been set.</returns>
0 commit comments