Skip to content

Commit 2428765

Browse files
committed
Remove leftover DiagnosticDescriptor-s
1 parent 9474591 commit 2428765

File tree

3 files changed

+44
-129
lines changed

3 files changed

+44
-129
lines changed

CommunityToolkit.Mvvm.SourceGenerators/AnalyzerReleases.Unshipped.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,13 @@ Rule ID | Category | Severity | Notes
77
--------|----------|----------|-------
88
MVVMTK0001 | CommunityToolkit.Mvvm.SourceGenerators.INotifyPropertyChangedGenerator | Error | See https://aka.ms/mvvmtoolkit/error
99
MVVMTK0002 | CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator | Error | See https://aka.ms/mvvmtoolkit/error
10-
MVVMTK0003 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
11-
MVVMTK0004 | CommunityToolkit.Mvvm.SourceGenerators.INotifyPropertyChangedGenerator | Error | See https://aka.ms/mvvmtoolkit/error
12-
MVVMTK0005 | CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator | Error | See https://aka.ms/mvvmtoolkit/error
13-
MVVMTK0006 | CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator | Error | See https://aka.ms/mvvmtoolkit/error
14-
MVVMTK0007 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
15-
MVVMTK0008 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
16-
MVVMTK0009 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
17-
MVVMTK0010 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
18-
MVVMTK0011 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
10+
MVVMTK0003 | CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator | Error | See https://aka.ms/mvvmtoolkit/error
11+
MVVMTK0004 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
12+
MVVMTK0005 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
13+
MVVMTK0006 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
14+
MVVMTK0007 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
15+
MVVMTK0008 | Microsoft.CodeAnalysis.CSharp.CSharpParseOptions | Error | See https://aka.ms/mvvmtoolkit/error
16+
MVVMTK0009 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
17+
MVVMTK0010 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
18+
MVVMTK0011 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
1919
MVVMTK0012 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
20-
MVVMTK0013 | Microsoft.CodeAnalysis.CSharp.CSharpParseOptions | Error | See https://aka.ms/mvvmtoolkit/error
21-
MVVMTK0014 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
22-
MVVMTK0015 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
23-
MVVMTK0016 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
24-
MVVMTK0017 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error

CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs

Lines changed: 12 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -13,62 +13,14 @@ namespace CommunityToolkit.Mvvm.SourceGenerators.Diagnostics;
1313
/// </summary>
1414
internal static class DiagnosticDescriptors
1515
{
16-
/// <summary>
17-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <see cref="INotifyPropertyChangedGenerator"/> failed to run on a given type.
18-
/// <para>
19-
/// Format: <c>"The generator INotifyPropertyChangedGenerator failed to execute on type {0}"</c>.
20-
/// </para>
21-
/// </summary>
22-
public static readonly DiagnosticDescriptor INotifyPropertyChangedGeneratorError = new(
23-
id: "MVVMTK0001",
24-
title: $"Internal error for {nameof(INotifyPropertyChangedGenerator)}",
25-
messageFormat: $"The generator {nameof(INotifyPropertyChangedGenerator)} failed to execute on type {{0}}",
26-
category: typeof(INotifyPropertyChangedGenerator).FullName,
27-
defaultSeverity: DiagnosticSeverity.Error,
28-
isEnabledByDefault: true,
29-
description: $"The {nameof(INotifyPropertyChangedGenerator)} generator encountered an error while processing a type. Please report this issue at https://aka.ms/mvvmtoolkit.",
30-
helpLinkUri: "https://aka.ms/mvvmtoolkit");
31-
32-
/// <summary>
33-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <see cref="ObservableObjectGenerator"/> failed to run on a given type.
34-
/// <para>
35-
/// Format: <c>"The generator ObservableObjectGenerator failed to execute on type {0}"</c>.
36-
/// </para>
37-
/// </summary>
38-
public static readonly DiagnosticDescriptor ObservableObjectGeneratorError = new(
39-
id: "MVVMTK0002",
40-
title: $"Internal error for {nameof(ObservableObjectGenerator)}",
41-
messageFormat: $"The generator {nameof(ObservableObjectGenerator)} failed to execute on type {{0}}",
42-
category: typeof(ObservableObjectGenerator).FullName,
43-
defaultSeverity: DiagnosticSeverity.Error,
44-
isEnabledByDefault: true,
45-
description: $"The {nameof(ObservableObjectGenerator)} generator encountered an error while processing a type. Please report this issue at https://aka.ms/mvvmtoolkit.",
46-
helpLinkUri: "https://aka.ms/mvvmtoolkit");
47-
48-
/// <summary>
49-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <see cref="ObservableRecipientGenerator"/> failed to run on a given type.
50-
/// <para>
51-
/// Format: <c>"The generator ObservableRecipientGenerator failed to execute on type {0}"</c>.
52-
/// </para>
53-
/// </summary>
54-
public static readonly DiagnosticDescriptor ObservableRecipientGeneratorError = new(
55-
id: "MVVMTK0003",
56-
title: $"Internal error for {nameof(ObservableRecipientGenerator)}",
57-
messageFormat: $"The generator {nameof(ObservableRecipientGenerator)} failed to execute on type {{0}}",
58-
category: typeof(ObservableRecipientGenerator).FullName,
59-
defaultSeverity: DiagnosticSeverity.Error,
60-
isEnabledByDefault: true,
61-
description: $"The {nameof(ObservableRecipientGenerator)} generator encountered an error while processing a type. Please report this issue at https://aka.ms/mvvmtoolkit.",
62-
helpLinkUri: "https://aka.ms/mvvmtoolkit");
63-
6416
/// <summary>
6517
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when a duplicate declaration of <see cref="INotifyPropertyChanged"/> would happen.
6618
/// <para>
6719
/// Format: <c>"Cannot apply [INotifyPropertyChangedAttribute] to type {0}, as it already declares the INotifyPropertyChanged interface"</c>.
6820
/// </para>
6921
/// </summary>
7022
public static readonly DiagnosticDescriptor DuplicateINotifyPropertyChangedInterfaceForINotifyPropertyChangedAttributeError = new(
71-
id: "MVVMTK0004",
23+
id: "MVVMTK0001",
7224
title: $"Duplicate {nameof(INotifyPropertyChanged)} definition",
7325
messageFormat: $"Cannot apply [INotifyPropertyChanged] to type {{0}}, as it already declares the {nameof(INotifyPropertyChanged)} interface",
7426
category: typeof(INotifyPropertyChangedGenerator).FullName,
@@ -84,7 +36,7 @@ internal static class DiagnosticDescriptors
8436
/// </para>
8537
/// </summary>
8638
public static readonly DiagnosticDescriptor DuplicateINotifyPropertyChangedInterfaceForObservableObjectAttributeError = new(
87-
id: "MVVMTK0005",
39+
id: "MVVMTK0002",
8840
title: $"Duplicate {nameof(INotifyPropertyChanged)} definition",
8941
messageFormat: $"Cannot apply [ObservableObject] to type {{0}}, as it already declares the {nameof(INotifyPropertyChanged)} interface",
9042
category: typeof(ObservableObjectGenerator).FullName,
@@ -100,7 +52,7 @@ internal static class DiagnosticDescriptors
10052
/// </para>
10153
/// </summary>
10254
public static readonly DiagnosticDescriptor DuplicateINotifyPropertyChangingInterfaceForObservableObjectAttributeError = new(
103-
id: "MVVMTK0006",
55+
id: "MVVMTK0003",
10456
title: $"Duplicate {nameof(INotifyPropertyChanging)} definition",
10557
messageFormat: $"Cannot apply [ObservableObject] to type {{0}}, as it already declares the {nameof(INotifyPropertyChanging)} interface",
10658
category: typeof(ObservableObjectGenerator).FullName,
@@ -116,7 +68,7 @@ internal static class DiagnosticDescriptors
11668
/// </para>
11769
/// </summary>
11870
public static readonly DiagnosticDescriptor DuplicateObservableRecipientError = new(
119-
id: "MVVMTK0007",
71+
id: "MVVMTK0004",
12072
title: "Duplicate ObservableRecipient definition",
12173
messageFormat: $"Cannot apply [ObservableRecipient] to type {{0}}, as it already inherits from the ObservableRecipient class",
12274
category: typeof(ObservableRecipientGenerator).FullName,
@@ -132,7 +84,7 @@ internal static class DiagnosticDescriptors
13284
/// </para>
13385
/// </summary>
13486
public static readonly DiagnosticDescriptor MissingBaseObservableObjectFunctionalityError = new(
135-
id: "MVVMTK0008",
87+
id: "MVVMTK0005",
13688
title: "Missing base ObservableObject functionality",
13789
messageFormat: $"Cannot apply [ObservableRecipient] to type {{0}}, as it lacks necessary base functionality (it should either inherit from ObservableObject, or be annotated with [ObservableObject] or [INotifyPropertyChanged])",
13890
category: typeof(ObservableRecipientGenerator).FullName,
@@ -148,7 +100,7 @@ internal static class DiagnosticDescriptors
148100
/// </para>
149101
/// </summary>
150102
public static readonly DiagnosticDescriptor MissingObservableValidatorInheritanceError = new(
151-
id: "MVVMTK0009",
103+
id: "MVVMTK0006",
152104
title: "Missing ObservableValidator inheritance",
153105
messageFormat: "The field {0}.{1} cannot be used to generate an observable property, as it has {2} validation attribute(s) but is declared in a type that doesn't inherit from ObservableValidator",
154106
category: typeof(ObservablePropertyGenerator).FullName,
@@ -157,46 +109,14 @@ internal static class DiagnosticDescriptors
157109
description: $"Cannot apply [ObservableProperty] to fields with validation attributes if they are declared in a type that doesn't inherit from ObservableValidator.",
158110
helpLinkUri: "https://aka.ms/mvvmtoolkit");
159111

160-
/// <summary>
161-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <see cref="ObservablePropertyGenerator"/> failed to run on a given type.
162-
/// <para>
163-
/// Format: <c>"The generator ObservablePropertyGenerator failed to execute on type {0}"</c>.
164-
/// </para>
165-
/// </summary>
166-
public static readonly DiagnosticDescriptor ObservablePropertyGeneratorError = new(
167-
id: "MVVMTK0010",
168-
title: $"Internal error for {nameof(ObservablePropertyGenerator)}",
169-
messageFormat: $"The generator {nameof(ObservablePropertyGenerator)} failed to execute on type {{0}}",
170-
category: typeof(ObservableObjectGenerator).FullName,
171-
defaultSeverity: DiagnosticSeverity.Error,
172-
isEnabledByDefault: true,
173-
description: $"The {nameof(ObservablePropertyGenerator)} generator encountered an error while processing a type. Please report this issue at https://aka.ms/mvvmtoolkit.",
174-
helpLinkUri: "https://aka.ms/mvvmtoolkit");
175-
176-
/// <summary>
177-
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when <see cref="ICommandGenerator"/> failed to run on a given type.
178-
/// <para>
179-
/// Format: <c>"The generator ICommandGenerator failed to execute on type {0}"</c>.
180-
/// </para>
181-
/// </summary>
182-
public static readonly DiagnosticDescriptor ICommandGeneratorError = new(
183-
id: "MVVMTK0011",
184-
title: $"Internal error for {nameof(ICommandGenerator)}",
185-
messageFormat: $"The generator {nameof(ICommandGenerator)} failed to execute on type {{0}}",
186-
category: typeof(ICommandGenerator).FullName,
187-
defaultSeverity: DiagnosticSeverity.Error,
188-
isEnabledByDefault: true,
189-
description: $"The {nameof(ICommandGenerator)} generator encountered an error while processing a type. Please report this issue at https://aka.ms/mvvmtoolkit.",
190-
helpLinkUri: "https://aka.ms/mvvmtoolkit");
191-
192112
/// <summary>
193113
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when an annotated method to generate a command for has an invalid signature.
194114
/// <para>
195115
/// 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>.
196116
/// </para>
197117
/// </summary>
198118
public static readonly DiagnosticDescriptor InvalidICommandMethodSignatureError = new(
199-
id: "MVVMTK0012",
119+
id: "MVVMTK0007",
200120
title: "Invalid ICommand method signature",
201121
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",
202122
category: typeof(ICommandGenerator).FullName,
@@ -209,7 +129,7 @@ internal static class DiagnosticDescriptors
209129
/// Gets a <see cref="DiagnosticDescriptor"/> indicating when an unsupported C# language version is being used.
210130
/// </summary>
211131
public static readonly DiagnosticDescriptor UnsupportedCSharpLanguageVersionError = new(
212-
id: "MVVMTK0013",
132+
id: "MVVMTK0008",
213133
title: "Unsupported C# language version",
214134
messageFormat: "The source generator features from the MVVM Toolkit require consuming projects to set the C# language version to at least C# 9.0",
215135
category: typeof(CSharpParseOptions).FullName,
@@ -225,7 +145,7 @@ internal static class DiagnosticDescriptors
225145
/// </para>
226146
/// </summary>
227147
public static readonly DiagnosticDescriptor InvalidCanExecuteMemberName = new(
228-
id: "MVVMTK0014",
148+
id: "MVVMTK0009",
229149
title: "Invalid ICommand.CanExecute member name",
230150
messageFormat: "The CanExecute name must refer to a valid member, but \"{0}\" has no matches in type {1}",
231151
category: typeof(ICommandGenerator).FullName,
@@ -241,7 +161,7 @@ internal static class DiagnosticDescriptors
241161
/// </para>
242162
/// </summary>
243163
public static readonly DiagnosticDescriptor MultipleCanExecuteMemberNameMatches = new(
244-
id: "MVVMTK0015",
164+
id: "MVVMTK0010",
245165
title: "Multiple ICommand.CanExecute member name matches",
246166
messageFormat: "The CanExecute name must refer to a single member, but \"{0}\" has multiple matches in type {1}",
247167
category: typeof(ICommandGenerator).FullName,
@@ -257,7 +177,7 @@ internal static class DiagnosticDescriptors
257177
/// </para>
258178
/// </summary>
259179
public static readonly DiagnosticDescriptor InvalidCanExecuteMember = new(
260-
id: "MVVMTK0016",
180+
id: "MVVMTK0011",
261181
title: "No valid ICommand.CanExecute member match",
262182
messageFormat: "The CanExecute name must refer to a compatible member, but no valid members were found for \"{0}\" in type {1}",
263183
category: typeof(ICommandGenerator).FullName,
@@ -273,7 +193,7 @@ internal static class DiagnosticDescriptors
273193
/// </para>
274194
/// </summary>
275195
public static readonly DiagnosticDescriptor InvalidConcurrentExecutionsParameterError = new(
276-
id: "MVVMTK0017",
196+
id: "MVVMTK0012",
277197
title: "Invalid concurrency control setting usage",
278198
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",
279199
category: typeof(ICommandGenerator).FullName,

0 commit comments

Comments
 (0)