public async Task<SerializableNavigateToSearchResult[]> SearchDocumentAsync(
             SerializableDocumentId documentId, string searchPattern, byte[] solutionChecksum)
        {
            var solution = await RoslynServices.SolutionService.GetSolutionAsync(
                new Checksum(solutionChecksum), CancellationToken).ConfigureAwait(false);

            var project = solution.GetDocument(documentId.Rehydrate());
            var result = await DefaultNavigateToEngineService.SearchDocumentInCurrentProcessAsync(
                project, searchPattern, CancellationToken).ConfigureAwait(false);

            return Convert(result);
        }
        private async Task <ImmutableArray <INavigateToSearchResult> > SearchDocumentInRemoteProcessAsync(
            RemoteHostClient client, Document document, string searchPattern, CancellationToken cancellationToken)
        {
            var solution = document.Project.Solution;

            using (var session = await client.CreateCodeAnalysisServiceSessionAsync(
                       solution, cancellationToken).ConfigureAwait(false))
            {
                var serializableResults = await session.InvokeAsync <SerializableNavigateToSearchResult[]>(
                    nameof(IRemoteNavigateToSearchService.SearchDocumentAsync),
                    SerializableDocumentId.Dehydrate(document),
                    searchPattern).ConfigureAwait(false);

                return(serializableResults.Select(r => r.Rehydrate(solution)).ToImmutableArray());
            }
        }
        public async Task FindReferencesAsync(
            SerializableSymbolAndProjectId symbolAndProjectIdArg, SerializableDocumentId[] documentArgs, 
            byte[] solutionChecksum)
        {
            var solution = await RoslynServices.SolutionService.GetSolutionAsync(
                new Checksum(solutionChecksum), CancellationToken).ConfigureAwait(false);

            var symbolAndProjectId = await symbolAndProjectIdArg.RehydrateAsync(
                solution, CancellationToken).ConfigureAwait(false);
            var documents = documentArgs?.Select(a => a.Rehydrate())
                                         .Select(solution.GetDocument)
                                         .ToImmutableHashSet();

            var progressCallback = new ProgressCallback(this);
            await DefaultSymbolFinderEngineService.FindReferencesInCurrentProcessAsync(
                symbolAndProjectId, solution, progressCallback, documents, CancellationToken).ConfigureAwait(false);
        }
 public Task OnFindInDocumentCompletedAsync(SerializableDocumentId documentId)
 {
     var document = _solution.GetDocument(documentId.Rehydrate());
     return _progress.OnFindInDocumentCompletedAsync(document);
 }
Пример #5
0
            public Task OnFindInDocumentCompletedAsync(SerializableDocumentId documentId)
            {
                var document = _solution.GetDocument(documentId.Rehydrate());

                return(_progress.OnFindInDocumentCompletedAsync(document));
            }