Ejemplo n.º 1
0
            private void ProcessAndRegisterMethodBody(MethodSymbol methodSymbol, BlockStmt?blockStatement)
            {
                if (blockStatement == null)
                {
                    return;
                }
                var rootBlock    = new ScopeSymbol(methodSymbol, blockStatement);
                var localVisitor = new LocalVariableDeclarationVisitor(_logger, rootBlock);

                localVisitor.Resolve(blockStatement);
                methodSymbol.Block = rootBlock;
            }
Ejemplo n.º 2
0
            public static ImmutableHashSet <ISymbol> GetAllSymbols(
                SemanticModel semanticModel,
                TExpressionSyntax methodDeclarationSyntax,
                CancellationToken cancellationToken)
            {
                var visitor   = new LocalVariableDeclarationVisitor(cancellationToken);
                var operation = semanticModel.GetOperation(methodDeclarationSyntax, cancellationToken);

                visitor.Visit(operation);

                return(visitor._allSymbols.ToImmutableHashSet());
            }