Skip to content

Commit

Permalink
Sort requied files
Browse files Browse the repository at this point in the history
  • Loading branch information
kzrnm committed Apr 3, 2021
1 parent 8ee2f06 commit 4963545
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Source/SourceExpander.Generator/CompilationExpander.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public string ExpandCode(SyntaxTree origTree, CancellationToken cancellationToke
var newRoot = typeFindAndUnusedUsingRemover.CompilationUnit;
if (typeFindAndUnusedUsingRemover.UsedTypeNames is not { } typeNames)
throw new InvalidOperationException($"{nameof(typeNames)} is null");
var requiedFiles = sourceFileContainer.ResolveDependency(typeNames);
var requiedFiles = sourceFileContainer.ResolveDependency(typeNames).ToArray();
Array.Sort(requiedFiles, (f1, f2) => StringComparer.Ordinal.Compare(f1.FileName, f2.FileName));

var usings = typeFindAndUnusedUsingRemover.RootUsings
.Union(requiedFiles.SelectMany(s => s.Usings))
Expand Down
Loading

0 comments on commit 4963545

Please sign in to comment.