コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: RemoteArguments.cs プロジェクト: xiongfang/roslyn
 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
     });
 }
コード例 #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)
     });
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 public Task OnFindInDocumentCompletedAsync(SerializableDocumentId documentId)
 {
     var document = _solution.GetDocument(documentId.Rehydrate());
     return _progress.OnFindInDocumentCompletedAsync(document);
 }
コード例 #7
0
 public Task OnFindInDocumentCompletedAsync(Document document)
 => _service.Rpc.InvokeAsync(nameof(OnFindInDocumentCompletedAsync),
                             SerializableDocumentId.Dehydrate(document));