public Task <IEnumerable <SymbolReferenceCount> > GetCoOccursCountsAsync(string graph, uint count)
 {
     using (TimedLog.Time(graph + " :: Co-occurrence Count"))
     {
         var result = new List <SymbolReferenceCount>();
         return(Task.FromResult(result.AsEnumerable()));
     }
 }
        public async Task <IEnumerable <FileResponse> > GetFileEntitiesAsync(string graph, string filePath)
        {
            using (TimedLog.Time(graph + " :: Get File"))
            {
                var fullPath     = Path.Combine(ROOT_DIR, filePath).Replace("/", @"\");
                var assemblyName = documentsAssemblyName[filePath];
                var provider     = await SolutionManager.GetProjectCodeProviderAsync(assemblyName);

                var result = await provider.GetDocumentEntitiesAsync(fullPath);

                foreach (var file in result)
                {
                    ProcessFileResponse(file);
                }

                return(result);
            }
        }
        public async Task <IEnumerable <FileResponse> > GetAllFilesAsync(string graph)
        {
            using (TimedLog.Time(graph + " :: Get All Files"))
            {
                var providers = await SolutionManager.GetProjectCodeProvidersAsync();

                var result = new List <FileResponse>();

                foreach (var provider in providers)
                {
                    var files = await provider.GetDocumentsAsync();

                    files = from f in files
                            where !FilterFile(f)
                            select f;

                    result.AddRange(files);
                }

                return(result);
            }
        }
        public async Task <IEnumerable <SymbolReference> > GetReferencesAsync(string graph, string uid)
        {
            using (TimedLog.Time(graph + " :: Get References"))
            {
                var result = new List <SymbolReference>();

                if (uid.Contains('@'))
                {
                    // Find all method definitions
                    var uidparts        = uid.Split('@');
                    var methodId        = uidparts[0];
                    var invocationIndex = Convert.ToInt32(uidparts[1]);

                    var methodDescriptor = MethodDescriptor.DeMarsall(methodId);
                    var methodEntity     = await SolutionManager.GetMethodEntityAsync(methodDescriptor);

                    var callees = await methodEntity.GetCalleesAsync(invocationIndex);

                    foreach (var callee in callees)
                    {
                        var provider = await SolutionManager.GetProjectCodeProviderAsync(callee);

                        var reference = await provider.GetDeclarationInfoAsync(callee);

                        //var calleeEntity = await SolutionManager.GetMethodEntityAsync(calleeDescriptor);
                        //var reference = await calleeEntity.GetDeclarationInfoAsync();

                        if (reference != null)
                        {
                            ProcessSymbolReference(reference);
                            result.Add(reference);
                        }
                    }
                }
                else
                {
                    // Find all method references
                    var methodId         = uid;
                    var methodDescriptor = MethodDescriptor.DeMarsall(methodId);
                    var methodEntity     = await SolutionManager.GetMethodEntityAsync(methodDescriptor);

                    var callers = await methodEntity.GetCallersAsync();

                    foreach (var caller in callers)
                    {
                        var provider = await SolutionManager.GetProjectCodeProviderAsync(caller.Caller);

                        var reference = await provider.GetInvocationInfoAsync(caller);

                        if (reference != null)
                        {
                            ProcessSymbolReference(reference);
                            result.Add(reference);
                        }
                    }

                    //var callers = await methodEntity.GetCallersDeclarationInfoAsync();

                    //foreach (var reference in callers)
                    //{
                    //	ProcessSymbolReference(reference);
                    //	result.Add(reference);
                    //}
                }

                return(result);
            }
        }