private static void AppendItem(this HierarchicalStringBuilder builder, DependenciesAnalysis.Reference reference)
 {
     builder.AppendItem("{0} ({1})", reference.Syntax, reference.Symbol?.Kind);
     //if (reference.TypeSymbols.Any()) {
     //    builder.AppendItem( "{0} ({1}): {2}", reference.Syntax, reference.Symbol?.Kind, reference.TypeSymbols.Join() );
     //} else {
     //    builder.AppendItem( "{0} ({1})", reference.Syntax, reference.Symbol?.Kind );
     //}
 }
 private static void AppendHierarchy(this HierarchicalStringBuilder builder, SyntaxNode scope, ImmutableArray <DependenciesAnalysis.Reference> references)
 {
     using (builder.AppendSection(scope)) {
         if (scope is StatementSyntax && scope.Parent?.Parent is MethodDeclarationSyntax)
         {
             builder.AppendText(scope.ToString());
         }
         foreach (var reference in references.Where(i => i.GetScope() == scope))
         {
             builder.AppendItem(reference);
         }
         foreach (var child in scope.ChildNodes().Where(IsScope))
         {
             // This loop enters into only direct children scopes, so it may not come to some scopes
             builder.AppendHierarchy(child, references);
         }
     }
 }