public static IList <MemberDeclarationSyntax> Start(InspectorContext context, MemberDeclarationSyntax memberDeclarationSyntax)
        {
            var operationUpVisitor = new DeclarationUpVisitor(context);

            operationUpVisitor.Visit(memberDeclarationSyntax);
            return(operationUpVisitor._topDeclarations.Values.ToList());
        }
        public static async Task <InspectorContext> Create(Solution solution)
        {
            var instance = new InspectorContext(solution.FilePath);
            await instance.CompileAsync(solution);

            return(instance);
        }
        private CallSequenceVisitor2(InspectorContext context, INamedTypeSymbol[] namedTypes)
        {
            _context        = context;
            _namedTypes     = namedTypes;
            _methodSequence = new List <MethodOnVariable>();

            _variables = new Stack <Dictionary <string, VariableIdentity> >();
        }
        public static IList <IList <string> > Start(InspectorContext context, MemberDeclarationSyntax memberDeclarationSyntax,
                                                    params string[] typeIdentifiers)
        {
            var semanticModel = context.GetSemanticModelFor(memberDeclarationSyntax);
            var namedTypes    = typeIdentifiers.Select(t => GetTypeByMetadataName(semanticModel, t)).ToArray();

            var visitor = new CallSequenceVisitor2(context, namedTypes);

            visitor.StartInternal(memberDeclarationSyntax, new List <ISymbol>());
            return(visitor.GetResults());
        }
        public static async Task <IList <MemberDeclarationSyntax> > GetMembers(
            InspectorContext context, Document document,
            bool collectMethods = true, bool collectProperties = false)
        {
            var visitor = new MemberExtractorVisitor(collectMethods, collectProperties);
            var root    = await document.GetSyntaxRootAsync();

            visitor._semanticModel = context.GetSemanticModelFor(root);

            visitor.Visit(root);
            return(visitor._members);
        }
        public static async Task <IList <MemberDeclarationSyntax> > GetMembers(
            InspectorContext context, Project project,
            bool collectMethods = true, bool collectProperties = false)
        {
            var visitor = new MemberExtractorVisitor(collectMethods, collectProperties);

            foreach (var document in project.Documents)
            {
                visitor._members.AddRange(
                    await GetMembers(context, document, collectMethods, collectProperties));
            }

            return(visitor._members);
        }
 private DeclarationUpVisitor(InspectorContext context)
 {
     _context         = context;
     _topDeclarations = new Dictionary <string, MemberDeclarationSyntax>();
     _alreadyVisited  = new HashSet <string>();
 }