Exemplo n.º 1
0
        public async Task <SerializableConflictResolution> DehydrateAsync(
            CancellationToken cancellationToken
            )
        {
            if (ErrorMessage != null)
            {
                return(new SerializableConflictResolution(ErrorMessage, resolution: null));
            }

            var documentTextChanges = await RemoteUtilities
                                      .GetDocumentTextChangesAsync(
                OldSolution,
                _newSolutionWithoutRenamedDocument,
                cancellationToken
                )
                                      .ConfigureAwait(false);

            return(new SerializableConflictResolution(
                       errorMessage: null,
                       new SuccessfulConflictResolution(
                           ReplacementTextValid,
                           _renamedDocument,
                           DocumentIds,
                           RelatedLocations,
                           documentTextChanges,
                           _documentToModifiedSpansMap,
                           _documentToComplexifiedSpansMap,
                           _documentToRelatedLocationsMap
                           )
                       ));
        }
Exemplo n.º 2
0
        public async Task <SerializableConflictResolution> DehydrateAsync(CancellationToken cancellationToken)
        {
            if (ErrorMessage != null)
            {
                return new SerializableConflictResolution {
                           ErrorMessage = ErrorMessage
                }
            }
            ;

            var documentTextChanges = await RemoteUtilities.GetDocumentTextChangesAsync(OldSolution, _newSolutionWithoutRenamedDocument, cancellationToken).ConfigureAwait(false);

            return(new SerializableConflictResolution
            {
                ReplacementTextValid = ReplacementTextValid,
                RenamedDocument = _renamedDocument,
                DocumentIds = DocumentIds.ToArray(),
                RelatedLocations = RelatedLocations.Select(loc => SerializableRelatedLocation.Dehydrate(loc)).ToArray(),
                DocumentTextChanges = documentTextChanges,
                DocumentToModifiedSpansMap = _documentToModifiedSpansMap.Select(kvp => (kvp.Key, kvp.Value)).ToArray(),
                DocumentToComplexifiedSpansMap = _documentToComplexifiedSpansMap.Select(kvp => (kvp.Key, kvp.Value.SelectAsArray(s => SerializableComplexifiedSpan.Dehydrate(s)))).ToArray(),
                DocumentToRelatedLocationsMap = _documentToRelatedLocationsMap.Select(kvp => (kvp.Key, kvp.Value.SelectAsArray(s => SerializableRelatedLocation.Dehydrate(s)))).ToArray(),
            });