Skip to content

Commit 4a0247f

Browse files
Razmo99JustinGrote
authored andcommitted
updated GetModifiedScript with changes from the VariableRenameTests, which is just sorting the changes
1 parent 3c125c5 commit 4a0247f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/PowerShellEditorServices.Test/Refactoring/RefactorUtilities.cs

+8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ public class RefactorUtilities
1212

1313
internal static string GetModifiedScript(string OriginalScript, ModifiedFileResponse Modification)
1414
{
15+
Modification.Changes.Sort((a, b) =>
16+
{
17+
if (b.StartLine == a.StartLine)
18+
{
19+
return b.EndColumn - a.EndColumn;
20+
}
21+
return b.StartLine - a.StartLine;
1522

23+
});
1624
string[] Lines = OriginalScript.Split(
1725
new string[] { Environment.NewLine },
1826
StringSplitOptions.None);

0 commit comments

Comments
 (0)