Skip to content

Commit c0c3425

Browse files
committed
Change ModCSharpSyntaxRewriter to exclude global usings
1 parent 17c551c commit c0c3425

File tree

1,576 files changed

+3
-14153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,576 files changed

+3
-14153
lines changed

.silktouch/ce565fcfc6aa78c8.stout

1.6 MB
Binary file not shown.

eng/silktouch/vulkan/settings.rsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TODO_DEFINE_MACROS=HERE
66
--include-directory
77
../../../submodules/vulkan-headers/include
88
# TODO: Remove this
9-
/usr/lib/clang/19/include
9+
/usr/lib/clang/20/include
1010
--with-callconv
1111
*=Winapi
1212
--with-librarypath

sources/SilkTouch/SilkTouch/Mods/Common/MSBuildModContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ public async Task InitializeAsync()
108108
throw new InvalidOperationException("Failed to locate source project.");
109109
}
110110

111-
// TODO: This currently causes the global usings to be output into each file. Not sure why.
112-
113111
// Remove all documents that are part of the output directory
114112
// This is to ensure that existing code is not used as the input for newly generated code,
115113
// which would cause a cycle.

sources/SilkTouch/SilkTouch/Mods/Common/ModCSharpSyntaxRewriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public Dictionary<string, UsingDirectiveSyntax> UsingsToAdd
3737
return ret;
3838
}
3939

40-
foreach (var use in comp.Usings)
40+
foreach (var use in comp.Usings.Where(use => !use.GlobalKeyword.IsKind(SyntaxKind.GlobalKeyword)))
4141
{
4242
AddUsing(use);
4343
}
@@ -68,7 +68,7 @@ and not SyntaxKind.MultiLineCommentTrivia
6868
FileScopedNamespaceDeclarationSyntax node
6969
)
7070
{
71-
foreach (var use in node.Usings)
71+
foreach (var use in node.Usings.Where(use => !use.GlobalKeyword.IsKind(SyntaxKind.GlobalKeyword)))
7272
{
7373
AddUsing(use);
7474
}

sources/Vulkan/Vulkan/Enums/AccessFlags2.gen.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// Ported from the Vulkan headers and corresponding dependencies.
44
// Original source is Copyright 2015-2023 The Khronos Group Inc. Licensed under the MIT license.
5-
global using global::System;
6-
global using global::System.Collections.Generic;
7-
global using global::System.IO;
8-
global using global::System.Linq;
9-
global using global::System.Net.Http;
10-
global using global::System.Threading;
11-
global using global::System.Threading.Tasks;
12-
global using Silk.NET.Core;
13-
global using static Silk.NET.Core.DSL;
145
using System;
156
using System.Reflection;
167
using System.Runtime.CompilerServices;

sources/Vulkan/Vulkan/Enums/AccessFlags3KHR.gen.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// Ported from the Vulkan headers and corresponding dependencies.
44
// Original source is Copyright 2015-2023 The Khronos Group Inc. Licensed under the MIT license.
5-
global using global::System;
6-
global using global::System.Collections.Generic;
7-
global using global::System.IO;
8-
global using global::System.Linq;
9-
global using global::System.Net.Http;
10-
global using global::System.Threading;
11-
global using global::System.Threading.Tasks;
12-
global using Silk.NET.Core;
13-
global using static Silk.NET.Core.DSL;
145
using System;
156
using System.Reflection;
167
using System.Runtime.CompilerServices;

sources/Vulkan/Vulkan/Enums/BufferUsageFlags2.gen.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// Ported from the Vulkan headers and corresponding dependencies.
44
// Original source is Copyright 2015-2023 The Khronos Group Inc. Licensed under the MIT license.
5-
global using global::System;
6-
global using global::System.Collections.Generic;
7-
global using global::System.IO;
8-
global using global::System.Linq;
9-
global using global::System.Net.Http;
10-
global using global::System.Threading;
11-
global using global::System.Threading.Tasks;
12-
global using Silk.NET.Core;
13-
global using static Silk.NET.Core.DSL;
145
using System;
156
using System.Reflection;
167
using System.Runtime.CompilerServices;

sources/Vulkan/Vulkan/Enums/ExportMetalObjectTypeFlagsEXT.gen.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// Ported from the Vulkan headers and corresponding dependencies.
44
// Original source is Copyright 2015-2023 The Khronos Group Inc. Licensed under the MIT license.
5-
global using global::System;
6-
global using global::System.Collections.Generic;
7-
global using global::System.IO;
8-
global using global::System.Linq;
9-
global using global::System.Net.Http;
10-
global using global::System.Threading;
11-
global using global::System.Threading.Tasks;
12-
global using Silk.NET.Core;
13-
global using static Silk.NET.Core.DSL;
145
using System;
156
using System.Reflection;
167
using System.Runtime.CompilerServices;

sources/Vulkan/Vulkan/Enums/FormatFeatureFlags2.gen.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// Ported from the Vulkan headers and corresponding dependencies.
44
// Original source is Copyright 2015-2023 The Khronos Group Inc. Licensed under the MIT license.
5-
global using global::System;
6-
global using global::System.Collections.Generic;
7-
global using global::System.IO;
8-
global using global::System.Linq;
9-
global using global::System.Net.Http;
10-
global using global::System.Threading;
11-
global using global::System.Threading.Tasks;
12-
global using Silk.NET.Core;
13-
global using static Silk.NET.Core.DSL;
145
using System;
156
using System.Reflection;
167
using System.Runtime.CompilerServices;

sources/Vulkan/Vulkan/Enums/ImageConstraintsInfoFlagsFuchsia.gen.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// Ported from the Vulkan headers and corresponding dependencies.
44
// Original source is Copyright 2015-2023 The Khronos Group Inc. Licensed under the MIT license.
5-
global using global::System;
6-
global using global::System.Collections.Generic;
7-
global using global::System.IO;
8-
global using global::System.Linq;
9-
global using global::System.Net.Http;
10-
global using global::System.Threading;
11-
global using global::System.Threading.Tasks;
12-
global using Silk.NET.Core;
13-
global using static Silk.NET.Core.DSL;
145
using System;
156
using System.Reflection;
167
using System.Runtime.CompilerServices;

0 commit comments

Comments
 (0)