-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9609 from drewnoakes/futdc-tidying
FUTDC tidying
- Loading branch information
Showing
7 changed files
with
71 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
...alStudio.ProjectSystem.Managed/ProjectSystem/LanguageServices/Handlers/HandlerServices.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...VisualStudio.ProjectSystem.Managed/ProjectSystem/Utilities/ProjectChangeDiffExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information. | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem; | ||
|
||
internal static class ProjectChangeDiffExtensions | ||
{ | ||
/// <summary> | ||
/// Normalizes <see cref="IProjectChangeDiff.RenamedItems"/> to <see cref="IProjectChangeDiff.AddedItems"/> | ||
/// and <see cref="IProjectChangeDiff.RemovedItems"/>. | ||
/// </summary> | ||
public static IProjectChangeDiff NormalizeRenames(this IProjectChangeDiff difference) | ||
{ | ||
// Optimize for common case | ||
if (difference.RenamedItems.Count == 0) | ||
{ | ||
return difference; | ||
} | ||
|
||
// Treat renamed items as just as an Add and Remove, makes finding conflicts easier | ||
IEnumerable<string> renamedNewNames = difference.RenamedItems.Select(r => r.Value); | ||
IEnumerable<string> renamedOldNames = difference.RenamedItems.Select(e => e.Key); | ||
|
||
IImmutableSet<string> added = difference.AddedItems.Union(renamedNewNames); | ||
IImmutableSet<string> removed = difference.RemovedItems.Union(renamedOldNames); | ||
|
||
return new ProjectChangeDiff(added, removed, difference.ChangedItems); | ||
} | ||
} |