Exemplo n.º 1
0
            public static string[] GetIdentifiers(Compilation compilation, SyntaxTree syntaxTree)
            {
                var semanticModel = compilation.GetSemanticModel(syntaxTree);
                var root          = syntaxTree.GetRoot();
                var walker        = new IdentifiersWalker(semanticModel);

                walker.Visit(root);
                return(walker._identifiers.ToArray());
            }
Exemplo n.º 2
0
            public static string[] GetIdentifiers(Script script)
            {
                var compilation   = script.GetCompilation();
                var syntaxTree    = compilation.SyntaxTrees.First();
                var semanticModel = compilation.GetSemanticModel(syntaxTree);
                var root          = syntaxTree.GetRoot();
                var walker        = new IdentifiersWalker(semanticModel);

                walker.Visit(root);
                return(walker._identifiers.ToArray());
            }