Example #1
0
        public override void VisitAccessorDeclaration(AccessorDeclarationSyntax node)
        {
            if (debug)
            {
                Console.WriteLine(node.ToFullString());
            }
            var nl   = OurLine.NewLine(LineKind.Decl, "AccessorDeclaration");
            var stms = node?.Body?.Statements.Select((x) => x.ToString());

            OurLine.AddEssentialInfo(ref nl, "keyword:" + node.Keyword.Text);
            if (stms != null)
            {
                var statements = string.Join("###", stms);
                OurLine.AddEssentialInfo(ref nl, "statements:" + statements);
            }

            OurLine.AddEssentialInfo(ref nl, "modifiers:" + node.Modifiers.ToString());
            OurLine.AddEssentialInfo(ref nl, "expressionBody:" + node.ExpressionBody?.ToString() ?? "");
            nl.Source = node.ToFullString();
            // nl.ParentKind = node.Parent.RawKind;
            nl.RawKind = node.RawKind;
            LogCommand(nl);
            StartBlock("AccessorDeclaration");
            base.VisitAccessorDeclaration(node);
            EndBlock("AccessorDeclaration");
        }