public Task <SerializableRenameLocations> FindRenameLocationsAsync(
            PinnedSolutionInfo solutionInfo,
            SerializableSymbolAndProjectId symbolAndProjectId,
            SerializableRenameOptionSet options,
            CancellationToken cancellationToken)
        {
            return(RunServiceAsync <SerializableRenameLocations>(async() =>
            {
                using (UserOperationBooster.Boost())
                {
                    var solution = await GetSolutionAsync(solutionInfo, cancellationToken).ConfigureAwait(false);

                    var symbol = await symbolAndProjectId.TryRehydrateAsync(
                        solution, cancellationToken).ConfigureAwait(false);

                    if (symbol == null)
                    {
                        return null;
                    }

                    var result = await RenameLocations.FindLocationsAsync(
                        symbol, solution, options.Rehydrate(), cancellationToken).ConfigureAwait(false);
                    return result.Dehydrate(solution, cancellationToken);
                }
            }, cancellationToken));
        }
        public Task <SerializableConflictResolution> RenameSymbolAsync(
            PinnedSolutionInfo solutionInfo,
            SerializableSymbolAndProjectId symbolAndProjectId,
            string newName,
            SerializableRenameOptionSet options,
            SerializableSymbolAndProjectId[] nonConflictSymbolIds,
            CancellationToken cancellationToken)
        {
            return(RunServiceAsync <SerializableConflictResolution>(async() =>
            {
                using (UserOperationBooster.Boost())
                {
                    var solution = await GetSolutionAsync(solutionInfo, cancellationToken).ConfigureAwait(false);

                    var symbol = await symbolAndProjectId.TryRehydrateAsync(
                        solution, cancellationToken).ConfigureAwait(false);

                    if (symbol == null)
                    {
                        return null;
                    }

                    var nonConflictSymbols = await GetNonConflictSymbolsAsync(solution, nonConflictSymbolIds, cancellationToken).ConfigureAwait(false);

                    var result = await Renamer.RenameSymbolAsync(
                        solution, symbol, newName, options.Rehydrate(),
                        nonConflictSymbols, cancellationToken).ConfigureAwait(false);
                    return await result.DehydrateAsync(cancellationToken).ConfigureAwait(false);
                }
            }, cancellationToken));
        }
Esempio n. 3
0
 public SerializableRenameLocations(
     SerializableSymbolAndProjectId?symbol,
     SerializableRenameOptionSet options,
     SerializableSearchResult?result
     )
 {
     Symbol  = symbol;
     Options = options;
     Result  = result;
 }
Esempio n. 4
0
 public SerializableRenameLocations Dehydrate(Solution solution, CancellationToken cancellationToken)
 => new SerializableRenameLocations(
     SerializableSymbolAndProjectId.Dehydrate(solution, Symbol, cancellationToken),
     SerializableRenameOptionSet.Dehydrate(Options),
     SerializableSearchResult.Dehydrate(solution, _result, cancellationToken));