internal static ImmutableArray<SyntaxNode> GetDeclarators(SourceMethodSymbol method)
 {
     var builder = ArrayBuilder<SyntaxNode>.GetInstance();
     var visitor = new LocalVariableDeclaratorsCollector(builder);
     visitor.Visit(method.BodySyntax);
     return builder.ToImmutableAndFree();
 }
Exemple #2
0
 public override ImmutableArray <SyntaxNode> GetDeclarators(ISymbol method)
 {
     Assert.True(method is MethodSymbol, "Only methods should have a syntax map.");
     return(LocalVariableDeclaratorsCollector.GetDeclarators(
                (SourceMemberMethodSymbol)method
                ));
 }
        internal static ImmutableArray <SyntaxNode> GetDeclarators(SourceMethodSymbol method)
        {
            var builder = ArrayBuilder <SyntaxNode> .GetInstance();

            var visitor = new LocalVariableDeclaratorsCollector(builder);

            visitor.Visit(method.BodySyntax);
            return(builder.ToImmutableAndFree());
        }
        internal static ImmutableArray<SyntaxNode> GetAllLocals(MethodSymbol method)
        {
            var sourceMethod = method as SourceMethodSymbol;
            if (sourceMethod == null)
            {
                return ImmutableArray<SyntaxNode>.Empty;
            }

            return LocalVariableDeclaratorsCollector.GetDeclarators(sourceMethod);
        }