示例#1
0
        public async Task <SerializableSymbolAndProjectId[]> FindProjectSourceDeclarationsWithPatternAsync(
            ProjectId projectId, string pattern, SymbolFilter criteria)
        {
            var solution = await GetSolutionAsync().ConfigureAwait(false);

            var project = solution.GetProject(projectId);

            var result = await DeclarationFinder.FindSourceDeclarationsWithPatternInCurrentProcessAsync(
                project, pattern, criteria, CancellationToken).ConfigureAwait(false);

            return(result.Select(SerializableSymbolAndProjectId.Dehydrate).ToArray());
        }
        public async Task <IList <SerializableSymbolAndProjectId> > FindProjectSourceDeclarationsWithPatternAsync(
            ProjectId projectId, string pattern, SymbolFilter criteria, CancellationToken cancellationToken)
        {
            using (UserOperationBooster.Boost())
            {
                var solution = await GetSolutionAsync(cancellationToken).ConfigureAwait(false);

                var project = solution.GetProject(projectId);

                var result = await DeclarationFinder.FindSourceDeclarationsWithPatternInCurrentProcessAsync(
                    project, pattern, criteria, cancellationToken).ConfigureAwait(false);

                return(result.SelectAsArray(SerializableSymbolAndProjectId.Dehydrate));
            }
        }
        public Task <IList <SerializableSymbolAndProjectId> > FindSolutionSourceDeclarationsWithPatternAsync(
            string pattern, SymbolFilter criteria, CancellationToken cancellationToken)
        {
            return(RunServiceAsync(async token =>
            {
                using (UserOperationBooster.Boost())
                {
                    var solution = await GetSolutionAsync(token).ConfigureAwait(false);

                    var result = await DeclarationFinder.FindSourceDeclarationsWithPatternInCurrentProcessAsync(
                        solution, pattern, criteria, token).ConfigureAwait(false);

                    return (IList <SerializableSymbolAndProjectId>)result.SelectAsArray(SerializableSymbolAndProjectId.Dehydrate);
                }
            }, cancellationToken));
        }
示例#4
0
        public Task <ImmutableArray <SerializableSymbolAndProjectId> > FindSolutionSourceDeclarationsWithPatternAsync(
            PinnedSolutionInfo solutionInfo, string pattern, SymbolFilter criteria, CancellationToken cancellationToken)
        {
            return(RunServiceAsync(async() =>
            {
                using (UserOperationBooster.Boost())
                {
                    var solution = await GetSolutionAsync(solutionInfo, cancellationToken).ConfigureAwait(false);

                    var result = await DeclarationFinder.FindSourceDeclarationsWithPatternInCurrentProcessAsync(
                        solution, pattern, criteria, cancellationToken).ConfigureAwait(false);

                    return Convert(result, solution, cancellationToken);
                }
            }, cancellationToken));
        }