Skip to content

Commit

Permalink
Hide infrastructural properties and fields from debugger display
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Dec 23, 2015
1 parent 1271b15 commit a7d88d7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/ImmutableObjectGraph.Generation/CodeGen+DeltaGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ protected PropertyDeclarationSyntax[] CreateBoilerplateEnumProperties()
SyntaxKind.SimpleMemberAccessExpression,
this.changedPropertiesEnumTypeName,
enumValueName)))
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken));
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute)));

return new PropertyDeclarationSyntax[] {
createProperty(nameof(RecursiveDiffingTypeHelper.ParentProperty), EnumValueParent),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ private void ImplementRecursiveParentInterface()
nameof(IRecursiveParent.Children))
.WithExplicitInterfaceSpecifier(SyntaxFactory.ExplicitInterfaceSpecifier(Syntax.GetTypeSyntax(typeof(IRecursiveParent))))
.WithExpressionBody(SyntaxFactory.ArrowExpressionClause(thisDotChildren))
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));

// public ParentedRecursiveType<TRecursiveParent, TRecursiveType> GetParentedNode(uint identity)
this.innerMembers.Add(
Expand Down Expand Up @@ -171,7 +172,8 @@ private void ImplementRecursiveParentInterface()
nameof(IRecursiveParent<IRecursiveType>.Children))
.WithExplicitInterfaceSpecifier(SyntaxFactory.ExplicitInterfaceSpecifier(irecursiveParentOfT))
.WithExpressionBody(SyntaxFactory.ArrowExpressionClause(thisDotChildren))
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));
}

private void ImplementOrderedChildrenInterface()
Expand Down
16 changes: 10 additions & 6 deletions src/ImmutableObjectGraph.Generation/CodeGen+FastSpineGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ protected override void GenerateCore()
.AddVariables(SyntaxFactory.VariableDeclarator(InefficiencyLoadFieldName.Identifier)))
.AddModifiers(
SyntaxFactory.Token(SyntaxKind.PrivateKeyword),
SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword)));
SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));

var interfaceType = SyntaxFactory.QualifiedName(
SyntaxFactory.IdentifierName(nameof(ImmutableObjectGraph)),
Expand All @@ -176,7 +177,8 @@ protected override void GenerateCore()
SyntaxFactory.PropertyDeclaration(inefficiencyLoadType, nameof(IRecursiveParentWithLookupTable<IRecursiveType>.InefficiencyLoad))
.WithExplicitInterfaceSpecifier(explicitImplementation)
.WithExpressionBody(SyntaxFactory.ArrowExpressionClause(Syntax.ThisDot(InefficiencyLoadFieldName)))
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));

// IReadOnlyCollection<TRecursiveType> IRecursiveParentWithLookupTable<TRecursiveType>.Children => this.recursiveField;
this.innerMembers.Add(
Expand All @@ -185,7 +187,8 @@ protected override void GenerateCore()
nameof(IRecursiveParentWithLookupTable<IRecursiveType>.Children))
.WithExplicitInterfaceSpecifier(explicitImplementation)
.WithExpressionBody(SyntaxFactory.ArrowExpressionClause(Syntax.ThisDot(this.applyTo.RecursiveField.NameAsProperty)))
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));

// ImmutableDictionary<IdentityFieldType, KeyValuePair<TRecursiveType, IdentityFieldType>> IRecursiveParentWithLookupTable<TRecursiveType>.LookupTable => this.lookupTable;
this.innerMembers.Add(
Expand All @@ -194,7 +197,8 @@ protected override void GenerateCore()
nameof(IRecursiveParentWithLookupTable<IRecursiveType>.LookupTable))
.WithExplicitInterfaceSpecifier(explicitImplementation)
.WithExpressionBody(SyntaxFactory.ArrowExpressionClause(Syntax.ThisDot(LookupTablePropertyName)))
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));
}

if (this.applyTo.IsRecursive)
Expand Down Expand Up @@ -251,8 +255,8 @@ protected override void GenerateCore()
this.innerMembers.Add(SyntaxFactory.FieldDeclaration(
SyntaxFactory.VariableDeclaration(this.lookupTableType)
.AddVariables(SyntaxFactory.VariableDeclarator(LookupTableFieldName.Identifier)))
.AddModifiers(
SyntaxFactory.Token(SyntaxKind.ProtectedKeyword)));
.AddModifiers(SyntaxFactory.Token(SyntaxKind.ProtectedKeyword))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));

// public System.Collections.Immutable.ImmutableStack<TRecursiveType> GetSpine(TRecursiveType descendent) {
// return this.GetSpine<TRecursiveParent, TRecursiveType>(descendent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ protected override void GenerateCore()
SyntaxFactory.ExplicitInterfaceSpecifier(Syntax.GetTypeSyntax(typeof(IRecursiveType))))
.WithExpressionBody(
SyntaxFactory.ArrowExpressionClause(Syntax.ThisDot(IdentityPropertyName)))
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
.WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
.AddAttributeLists(SyntaxFactory.AttributeList(SyntaxFactory.SingletonSeparatedList(DebuggerBrowsableNeverAttribute))));
}
}
}
Expand Down

0 comments on commit a7d88d7

Please sign in to comment.