Add and adopt WriteSortedUsingDirectives extension

このコミットが含まれているのは:
Sergio Pedri committed 2023-10-14 02:28:02 +02:00
1 親 fd47d242bb
コミット e909262a97
2ファイル変更
+28 -18

検索条件に一致するファイルはありません

+2 -18
ファイルの表示
@@ -249,24 +249,8 @@ public sealed partial class D2DPixelShaderDescriptorGenerator : IIncrementalGene
using (writer.WriteBlock())
{
// Add the System directives first, in the correct order
foreach (string usingDirective in usingDirectives.AsEnumerable().Where(static name => name.StartsWith("global::System")).OrderBy(static name => name))
{
writer.WriteLine($"using {usingDirective};");
}
// Add the other directives, also sorted in the correct order
foreach (string usingDirective in usingDirectives.AsEnumerable().Where(static name => !name.StartsWith("global::System")).OrderBy(static name => name))
{
writer.WriteLine($"using {usingDirective};");
}
foreach (IndentedTextWriter.Callback<D2D1ShaderInfo> callback in additionalTypes.WrittenSpan)
{
writer.WriteLine();
callback(item, writer);
}
writer.WriteSortedUsingDirectives(usingDirectives.AsEnumerable());
writer.WriteLineSeparatedMembers(additionalTypes.WrittenSpan, (callback, writer) => callback(item, writer));
}
}