Skip to content

Commit

Permalink
Sort by alias
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Jul 4, 2023
1 parent 0e9b796 commit 1f7181a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using A = Z;
using M = A;
using Z = M;
5 changes: 5 additions & 0 deletions Src/CSharpier/SyntaxPrinter/UsingDirectives.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ public int Compare(UsingDirectiveSyntax? x, UsingDirectiveSyntax? y)
return 1;
}

if (x.Alias is NameEqualsSyntax xAlias && y.Alias is NameEqualsSyntax yAlias)
{
return xAlias.ToFullString().CompareTo(yAlias.ToFullString());
}

var xIsSystem = IsSystemName(x.Name);
var yIsSystem = IsSystemName(y.Name);

Expand Down

0 comments on commit 1f7181a

Please sign in to comment.