private void append(TreeViewItem _rootItem, SyntaxNode _node) { if (__treeView.Items.Count == 0) { __treeView.Items.Add(_rootItem); } ChildSyntaxList _children = _node.ChildNodesAndTokens(); ChildSyntaxList.Enumerator _enumerator = _children.GetEnumerator(); while (_enumerator.MoveNext()) { SyntaxNodeOrToken _syntaxElement = _enumerator.Current; if (_syntaxElement.IsNode) { SyntaxNode _childNode = _syntaxElement.AsNode(); TreeViewItem _childNodeItem = syntaxNodeItem(_childNode); _rootItem.Items.Add(_childNodeItem); append(_childNodeItem, _childNode); } else if (_syntaxElement.IsToken) { SyntaxToken _token = _syntaxElement.AsToken(); _rootItem.Items.Add(syntaxTokenItem(_token)); } } }
public override SyntaxNode VisitBaseList(BaseListSyntax node) { ChildSyntaxList.Enumerator enumerator = node.ChildNodesAndTokens().GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current is { IsNode : true } current) { SyntaxNode currentNode = current.AsNode(); if (currentNode is SimpleBaseTypeSyntax nodeToRemove && (nodeToRemove.Type.ToString() == "global::System.Object" || nodeToRemove.Type.ToString() == "System.Object")) { node = node.RemoveNode(nodeToRemove, SyntaxRemoveOptions.KeepNoTrivia); break; } } } return(node.ChildNodes().Any() ? base.VisitBaseList(node) : null); }
public DifferenceInfo(ChildSyntaxList.Enumerator oldChildren, ChildSyntaxList.Enumerator newChildren) { this.oldChildren = oldChildren; this.newChildren = newChildren; }