public async Task <SerializableNavigateToSearchResult[]> SearchDocumentAsync(
            SerializableDocumentId documentId, string searchPattern)
        {
            var solution = await GetSolutionAsync().ConfigureAwait(false);

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

            return(Convert(result));
        }
        public async Task<SerializableNavigateToSearchResult[]> SearchDocumentAsync(
             SerializableDocumentId documentId, string searchPattern, byte[] solutionChecksum)
        {
            var solution = await GetSolutionAsync().ConfigureAwait(false);

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

            return Convert(result);
        }
Exemple #3
0
 public static SerializableReferenceLocation Dehydrate(
     ReferenceLocation referenceLocation)
 {
     return(new SerializableReferenceLocation
     {
         Document = SerializableDocumentId.Dehydrate(referenceLocation.Document),
         Alias = SerializableSymbolAndProjectId.Dehydrate(referenceLocation.Alias, referenceLocation.Document),
         Location = SerializableTextSpan.Dehydrate(referenceLocation.Location.SourceSpan),
         IsImplicit = referenceLocation.IsImplicit,
         IsWrittenTo = referenceLocation.IsWrittenTo,
         CandidateReason = referenceLocation.CandidateReason
     });
 }
Exemple #4
0
 public static SerializableNavigableItem Dehydrate(INavigableItem item)
 {
     return(new SerializableNavigableItem
     {
         Glyph = item.Glyph,
         DisplayTaggedParts = SerializableTaggedText.Dehydrate(item.DisplayTaggedParts),
         DisplayFileLocation = item.DisplayFileLocation,
         IsImplicitlyDeclared = item.IsImplicitlyDeclared,
         Document = SerializableDocumentId.Dehydrate(item.Document),
         SourceSpan = SerializableTextSpan.Dehydrate(item.SourceSpan),
         ChildItems = SerializableNavigableItem.Dehydrate(item.ChildItems)
     });
 }
        public async Task FindReferencesAsync(SerializableSymbolAndProjectId symbolAndProjectIdArg, SerializableDocumentId[] documentArgs)
        {
            var solution = await GetSolutionAsync().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 SymbolFinder.FindReferencesInCurrentProcessAsync(
                symbolAndProjectId, solution, progressCallback, documents, CancellationToken).ConfigureAwait(false);
        }
 public Task OnFindInDocumentCompletedAsync(SerializableDocumentId documentId)
 {
     var document = _solution.GetDocument(documentId.Rehydrate());
     return _progress.OnFindInDocumentCompletedAsync(document);
 }
 public Task OnFindInDocumentCompletedAsync(Document document)
 => _service.Rpc.InvokeAsync(nameof(OnFindInDocumentCompletedAsync),
                             SerializableDocumentId.Dehydrate(document));