Skip to content

Commit c9839ef

Browse files
committed
Remove [DebuggerNonUserCode] from visible members
1 parent fa9114b commit c9839ef

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ public static MemberDeclarationSyntax GetPropertySyntax(PropertyInfo propertyInf
276276
//
277277
// /// <inheritdoc cref="<FIELD_NAME>"/>
278278
// [global::System.CodeDom.Compiler.GeneratedCode("...", "...")]
279-
// [global::System.Diagnostics.DebuggerNonUserCode]
280279
// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
281280
// <VALIDATION_ATTRIBUTES>
282281
// public <FIELD_TYPE><NULLABLE_ANNOTATION?> <PROPERTY_NAME>
@@ -296,7 +295,6 @@ public static MemberDeclarationSyntax GetPropertySyntax(PropertyInfo propertyInf
296295
AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(typeof(ObservablePropertyGenerator).FullName))),
297296
AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(typeof(ObservablePropertyGenerator).Assembly.GetName().Version.ToString()))))))
298297
.WithOpenBracketToken(Token(TriviaList(Comment($"/// <inheritdoc cref=\"{propertyInfo.FieldName}\"/>")), SyntaxKind.OpenBracketToken, TriviaList())),
299-
AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Diagnostics.DebuggerNonUserCode")))),
300298
AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage")))))
301299
.AddAttributeLists(validationAttributes.ToArray())
302300
.AddModifiers(Token(SyntaxKind.PublicKeyword))

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ public static void ProcessMemberDeclarations(
6868
AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(generatorType.Assembly.GetName().Version.ToString())))))))
6969
.WithLeadingTrivia(member.GetLeadingTrivia());
7070

71-
// [DebuggerNonUserCode] is not supported over interfaces, events or fields
72-
if (member.Kind() is not SyntaxKind.InterfaceDeclaration and not SyntaxKind.EventFieldDeclaration and not SyntaxKind.FieldDeclaration)
73-
{
74-
member = member.AddAttributeLists(AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Diagnostics.DebuggerNonUserCode")))));
75-
}
76-
7771
// [ExcludeFromCodeCoverage] is not supported on interfaces and fields
7872
if (member.Kind() is not SyntaxKind.InterfaceDeclaration and not SyntaxKind.FieldDeclaration)
7973
{

CommunityToolkit.Mvvm.SourceGenerators/Input/ICommandGenerator.Execute.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ public static ImmutableArray<MemberDeclarationSyntax> GetSyntax(CommandInfo comm
207207
//
208208
// /// <summary>Gets an <see cref="<COMMAND_INTERFACE_TYPE>" instance wrapping <see cref="<METHOD_NAME>"/> and <see cref="<OPTIONAL_CAN_EXECUTE>"/>.</summary>
209209
// [global::System.CodeDom.Compiler.GeneratedCode("...", "...")]
210-
// [global::System.Diagnostics.DebuggerNonUserCode]
211210
// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
212211
// public <COMMAND_TYPE> <COMMAND_PROPERTY_NAME> => <COMMAND_FIELD_NAME> ??= new <RELAY_COMMAND_TYPE>(<COMMAND_CREATION_ARGUMENTS>);
213212
PropertyDeclarationSyntax propertyDeclaration =
@@ -225,7 +224,6 @@ public static ImmutableArray<MemberDeclarationSyntax> GetSyntax(CommandInfo comm
225224
$"/// <summary>Gets an <see cref=\"{commandInterfaceTypeXmlName}\"/> instance wrapping <see cref=\"{commandInfo.MethodName}\"/>.</summary>")),
226225
SyntaxKind.OpenBracketToken,
227226
TriviaList())),
228-
AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Diagnostics.DebuggerNonUserCode")))),
229227
AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage")))))
230228
.WithExpressionBody(
231229
ArrowExpressionClause(
@@ -265,7 +263,6 @@ public static ImmutableArray<MemberDeclarationSyntax> GetSyntax(CommandInfo comm
265263
//
266264
// /// <summary>Gets an <see cref="global::System.Windows.Input.ICommand" instance that can be used to cancel <see cref="<COMMAND_PROPERTY_NAME>"/>.</summary>
267265
// [global::System.CodeDom.Compiler.GeneratedCode("...", "...")]
268-
// [global::System.Diagnostics.DebuggerNonUserCode]
269266
// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
270267
// public global::System.Windows.Input.ICommand <CANCEL_COMMAND_PROPERTY_NAME> => <CANCEL_COMMAND_FIELD_NAME> ??= global::CommunityToolkit.Mvvm.Input.IAsyncRelayCommandExtensions.CreateCancelCommand(<COMMAND_PROPERTY_NAME>);
271268
PropertyDeclarationSyntax cancelCommandPropertyDeclaration =
@@ -283,7 +280,6 @@ public static ImmutableArray<MemberDeclarationSyntax> GetSyntax(CommandInfo comm
283280
$"/// <summary>Gets an <see cref=\"global::System.Windows.Input.ICommand\"/> instance that can be used to cancel <see cref=\"{commandInfo.PropertyName}\"/>.</summary>")),
284281
SyntaxKind.OpenBracketToken,
285282
TriviaList())),
286-
AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Diagnostics.DebuggerNonUserCode")))),
287283
AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage")))))
288284
.WithExpressionBody(
289285
ArrowExpressionClause(

0 commit comments

Comments
 (0)