From bb95f738a826fa2ccea46eb0f507c1f4faf5b37e Mon Sep 17 00:00:00 2001
From: GeWuYou <95328647+GeWuYou@users.noreply.github.com>
Date: Tue, 27 Jan 2026 12:44:51 +0800
Subject: [PATCH] =?UTF-8?q?chore(project):=20=E7=A6=81=E7=94=A8=E9=9A=90?=
=?UTF-8?q?=E5=BC=8Fusing=E5=B9=B6=E6=B7=BB=E5=8A=A0=E5=85=A8=E5=B1=80usin?=
=?UTF-8?q?g=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在所有项目中禁用 ImplicitUsings 配置
- 为所有项目添加 GlobalUsings.cs 文件统一管理常用命名空间
- 统一添加 System、System.Collections.Generic、System.Linq、System.Threading 和 System.Threading.Tasks 的全局引用
- 更新项目文件中的 PackageReference 格式规范化
- 移除各个源文件顶部的重复 using 语句
- 添加标准版权头注释到全局引用文件
---
GFramework.Core.Abstractions/GlobalUsings.cs | 18 +++++++++++++++
.../GFramework.Core.Tests.csproj | 10 ++++-----
GFramework.Core.Tests/GlobalUsings.cs | 18 +++++++++++++++
.../architecture/TestArchitectureBase.cs | 1 -
.../coroutine/YieldInstructionTests.cs | 1 +
.../logging/ConsoleLoggerTests.cs | 1 +
.../logging/LoggerFactoryTests.cs | 11 +++++-----
GFramework.Core/GlobalUsings.cs | 1 +
GFramework.Game.Abstractions/GlobalUsings.cs | 18 +++++++++++++++
GFramework.Game/GFramework.Game.csproj | 8 +++----
GFramework.Game/GlobalUsings.cs | 18 +++++++++++++++
GFramework.Game/storage/FileStorage.cs | 1 +
.../GlobalUsings.cs | 18 +++++++++++++++
.../GlobalUsings.cs | 18 +++++++++++++++
GFramework.Godot/GFramework.Godot.csproj | 14 ++++++------
GFramework.Godot/GlobalUsings.cs | 18 +++++++++++++++
GFramework.Godot/storage/GodotFileStorage.cs | 1 +
.../GlobalUsings.cs | 18 +++++++++++++++
.../GlobalUsings.cs | 18 +++++++++++++++
.../GFramework.SourceGenerators.Tests.csproj | 22 +++++++++----------
.../GlobalUsings.cs | 18 +++++++++++++++
.../core/GeneratorSnapshotTest.cs | 3 ++-
.../EnumExtensionsGeneratorSnapshotTests.cs | 1 +
.../logging/LoggerGeneratorSnapshotTests.cs | 1 +
.../ContextAwareGeneratorSnapshotTests.cs | 3 ++-
GFramework.SourceGenerators/GlobalUsings.cs | 18 +++++++++++++++
26 files changed, 242 insertions(+), 35 deletions(-)
create mode 100644 GFramework.Core.Abstractions/GlobalUsings.cs
create mode 100644 GFramework.Core.Tests/GlobalUsings.cs
create mode 100644 GFramework.Game.Abstractions/GlobalUsings.cs
create mode 100644 GFramework.Game/GlobalUsings.cs
create mode 100644 GFramework.Godot.SourceGenerators.Abstractions/GlobalUsings.cs
create mode 100644 GFramework.Godot.SourceGenerators/GlobalUsings.cs
create mode 100644 GFramework.Godot/GlobalUsings.cs
create mode 100644 GFramework.SourceGenerators.Abstractions/GlobalUsings.cs
create mode 100644 GFramework.SourceGenerators.Common/GlobalUsings.cs
create mode 100644 GFramework.SourceGenerators.Tests/GlobalUsings.cs
create mode 100644 GFramework.SourceGenerators/GlobalUsings.cs
diff --git a/GFramework.Core.Abstractions/GlobalUsings.cs b/GFramework.Core.Abstractions/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.Core.Abstractions/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Core.Tests/GFramework.Core.Tests.csproj b/GFramework.Core.Tests/GFramework.Core.Tests.csproj
index e505aab..cf4b142 100644
--- a/GFramework.Core.Tests/GFramework.Core.Tests.csproj
+++ b/GFramework.Core.Tests/GFramework.Core.Tests.csproj
@@ -1,18 +1,18 @@
- enable
+ disable
enable
net10.0;net8.0
-
-
-
+
+
+
-
+
diff --git a/GFramework.Core.Tests/GlobalUsings.cs b/GFramework.Core.Tests/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.Core.Tests/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Core.Tests/architecture/TestArchitectureBase.cs b/GFramework.Core.Tests/architecture/TestArchitectureBase.cs
index 1844cb0..5ffffbe 100644
--- a/GFramework.Core.Tests/architecture/TestArchitectureBase.cs
+++ b/GFramework.Core.Tests/architecture/TestArchitectureBase.cs
@@ -1,6 +1,5 @@
using GFramework.Core.Abstractions.enums;
using GFramework.Core.architecture;
-using GFramework.Core.events;
namespace GFramework.Core.Tests.architecture;
diff --git a/GFramework.Core.Tests/coroutine/YieldInstructionTests.cs b/GFramework.Core.Tests/coroutine/YieldInstructionTests.cs
index 3509345..3f4b576 100644
--- a/GFramework.Core.Tests/coroutine/YieldInstructionTests.cs
+++ b/GFramework.Core.Tests/coroutine/YieldInstructionTests.cs
@@ -188,6 +188,7 @@ public class YieldInstructionTests
///
/// 验证WaitUntil指令应该在条件满足时完成
///
+ [Test]
public void WaitUntil_Should_Be_Done_When_Condition_Is_True()
{
var counter = 0;
diff --git a/GFramework.Core.Tests/logging/ConsoleLoggerTests.cs b/GFramework.Core.Tests/logging/ConsoleLoggerTests.cs
index 7fc7054..e754a9e 100644
--- a/GFramework.Core.Tests/logging/ConsoleLoggerTests.cs
+++ b/GFramework.Core.Tests/logging/ConsoleLoggerTests.cs
@@ -1,3 +1,4 @@
+using System.IO;
using GFramework.Core.Abstractions.logging;
using GFramework.Core.logging;
using NUnit.Framework;
diff --git a/GFramework.Core.Tests/logging/LoggerFactoryTests.cs b/GFramework.Core.Tests/logging/LoggerFactoryTests.cs
index 43b2b23..d3529dd 100644
--- a/GFramework.Core.Tests/logging/LoggerFactoryTests.cs
+++ b/GFramework.Core.Tests/logging/LoggerFactoryTests.cs
@@ -1,3 +1,4 @@
+using System.IO;
using GFramework.Core.Abstractions.logging;
using GFramework.Core.logging;
using NUnit.Framework;
@@ -45,7 +46,7 @@ public class LoggerFactoryTests
public void ConsoleLoggerFactory_GetLogger_WithDefaultMinLevel_ShouldUseInfo()
{
var factory = new ConsoleLoggerFactory();
- var logger = (ConsoleLogger)factory.GetLogger("TestLogger");
+ _ = (ConsoleLogger)factory.GetLogger("TestLogger");
var stringWriter = new StringWriter();
var testLogger = new ConsoleLogger("TestLogger", LogLevel.Info, stringWriter, false);
@@ -66,7 +67,7 @@ public class LoggerFactoryTests
public void ConsoleLoggerFactoryProvider_CreateLogger_ShouldReturnLoggerWithProviderMinLevel()
{
var provider = new ConsoleLoggerFactoryProvider { MinLevel = LogLevel.Debug };
- var logger = (ConsoleLogger)provider.CreateLogger("TestLogger");
+ _ = (ConsoleLogger)provider.CreateLogger("TestLogger");
var stringWriter = new StringWriter();
var testLogger = new ConsoleLogger("TestLogger", LogLevel.Debug, stringWriter, false);
@@ -177,7 +178,7 @@ public class LoggerFactoryTests
LoggerFactoryResolver.Provider = provider;
- var logger = (ConsoleLogger)provider.CreateLogger("TestLogger");
+ _ = (ConsoleLogger)provider.CreateLogger("TestLogger");
var stringWriter = new StringWriter();
var testLogger = new ConsoleLogger("TestLogger", LogLevel.Warning, stringWriter, false);
@@ -204,7 +205,7 @@ public class LoggerFactoryTests
LoggerFactoryResolver.MinLevel = LogLevel.Error;
var provider = LoggerFactoryResolver.Provider;
- var logger = (ConsoleLogger)provider.CreateLogger("TestLogger");
+ _ = (ConsoleLogger)provider.CreateLogger("TestLogger");
var stringWriter = new StringWriter();
var testLogger = new ConsoleLogger("TestLogger", LogLevel.Error, stringWriter, false);
@@ -241,7 +242,7 @@ public class LoggerFactoryTests
public void ConsoleLoggerFactoryProvider_MinLevel_DoesNotAffectCreatedLogger()
{
var provider = new ConsoleLoggerFactoryProvider { MinLevel = LogLevel.Error };
- var logger = provider.CreateLogger("TestLogger");
+ provider.CreateLogger("TestLogger");
var stringWriter = new StringWriter();
var testLogger = new ConsoleLogger("TestLogger", LogLevel.Error, stringWriter, false);
diff --git a/GFramework.Core/GlobalUsings.cs b/GFramework.Core/GlobalUsings.cs
index e44a261..4d27181 100644
--- a/GFramework.Core/GlobalUsings.cs
+++ b/GFramework.Core/GlobalUsings.cs
@@ -14,4 +14,5 @@
global using System;
global using System.Collections.Generic;
global using System.Linq;
+global using System.Threading;
global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Game.Abstractions/GlobalUsings.cs b/GFramework.Game.Abstractions/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.Game.Abstractions/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Game/GFramework.Game.csproj b/GFramework.Game/GFramework.Game.csproj
index b81965b..5890d47 100644
--- a/GFramework.Game/GFramework.Game.csproj
+++ b/GFramework.Game/GFramework.Game.csproj
@@ -3,14 +3,14 @@
GeWuYou.$(AssemblyName)
net8.0;net9.0;net10.0
- enable
+ disable
enable
-
-
+
+
-
+
diff --git a/GFramework.Game/GlobalUsings.cs b/GFramework.Game/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.Game/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Game/storage/FileStorage.cs b/GFramework.Game/storage/FileStorage.cs
index b75ed8a..1f34f6c 100644
--- a/GFramework.Game/storage/FileStorage.cs
+++ b/GFramework.Game/storage/FileStorage.cs
@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
+using System.IO;
using System.Text;
using GFramework.Game.Abstractions.serializer;
using GFramework.Game.Abstractions.storage;
diff --git a/GFramework.Godot.SourceGenerators.Abstractions/GlobalUsings.cs b/GFramework.Godot.SourceGenerators.Abstractions/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.Godot.SourceGenerators.Abstractions/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Godot.SourceGenerators/GlobalUsings.cs b/GFramework.Godot.SourceGenerators/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.Godot.SourceGenerators/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Godot/GFramework.Godot.csproj b/GFramework.Godot/GFramework.Godot.csproj
index a77478d..1f12634 100644
--- a/GFramework.Godot/GFramework.Godot.csproj
+++ b/GFramework.Godot/GFramework.Godot.csproj
@@ -2,20 +2,20 @@
GeWuYou.$(AssemblyName)
- enable
+ disable
enable
net8.0;net9.0;net10.0
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/GFramework.Godot/GlobalUsings.cs b/GFramework.Godot/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.Godot/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Godot/storage/GodotFileStorage.cs b/GFramework.Godot/storage/GodotFileStorage.cs
index 324f590..fe79a7e 100644
--- a/GFramework.Godot/storage/GodotFileStorage.cs
+++ b/GFramework.Godot/storage/GodotFileStorage.cs
@@ -1,4 +1,5 @@
using System.Collections.Concurrent;
+using System.IO;
using System.Text;
using GFramework.Core.Abstractions.storage;
using GFramework.Game.Abstractions.serializer;
diff --git a/GFramework.SourceGenerators.Abstractions/GlobalUsings.cs b/GFramework.SourceGenerators.Abstractions/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.SourceGenerators.Abstractions/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.SourceGenerators.Common/GlobalUsings.cs b/GFramework.SourceGenerators.Common/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.SourceGenerators.Common/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj b/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj
index e60f46a..1ed47ce 100644
--- a/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj
+++ b/GFramework.SourceGenerators.Tests/GFramework.SourceGenerators.Tests.csproj
@@ -1,29 +1,29 @@
- enable
+ disable
enable
net10.0;net8.0
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
+
diff --git a/GFramework.SourceGenerators.Tests/GlobalUsings.cs b/GFramework.SourceGenerators.Tests/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.SourceGenerators.Tests/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.SourceGenerators.Tests/core/GeneratorSnapshotTest.cs b/GFramework.SourceGenerators.Tests/core/GeneratorSnapshotTest.cs
index 47a6230..e826559 100644
--- a/GFramework.SourceGenerators.Tests/core/GeneratorSnapshotTest.cs
+++ b/GFramework.SourceGenerators.Tests/core/GeneratorSnapshotTest.cs
@@ -1,4 +1,5 @@
-using Microsoft.CodeAnalysis.CSharp.Testing;
+using System.IO;
+using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing;
using NUnit.Framework;
diff --git a/GFramework.SourceGenerators.Tests/enums/EnumExtensionsGeneratorSnapshotTests.cs b/GFramework.SourceGenerators.Tests/enums/EnumExtensionsGeneratorSnapshotTests.cs
index 2a84399..e21149b 100644
--- a/GFramework.SourceGenerators.Tests/enums/EnumExtensionsGeneratorSnapshotTests.cs
+++ b/GFramework.SourceGenerators.Tests/enums/EnumExtensionsGeneratorSnapshotTests.cs
@@ -1,3 +1,4 @@
+using System.IO;
using GFramework.SourceGenerators.enums;
using GFramework.SourceGenerators.Tests.core;
using NUnit.Framework;
diff --git a/GFramework.SourceGenerators.Tests/logging/LoggerGeneratorSnapshotTests.cs b/GFramework.SourceGenerators.Tests/logging/LoggerGeneratorSnapshotTests.cs
index 2cb4278..670321f 100644
--- a/GFramework.SourceGenerators.Tests/logging/LoggerGeneratorSnapshotTests.cs
+++ b/GFramework.SourceGenerators.Tests/logging/LoggerGeneratorSnapshotTests.cs
@@ -1,3 +1,4 @@
+using System.IO;
using GFramework.SourceGenerators.logging;
using GFramework.SourceGenerators.Tests.core;
using NUnit.Framework;
diff --git a/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorSnapshotTests.cs b/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorSnapshotTests.cs
index 73a40fd..38a15a6 100644
--- a/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorSnapshotTests.cs
+++ b/GFramework.SourceGenerators.Tests/rule/ContextAwareGeneratorSnapshotTests.cs
@@ -1,4 +1,5 @@
-using GFramework.SourceGenerators.rule;
+using System.IO;
+using GFramework.SourceGenerators.rule;
using GFramework.SourceGenerators.Tests.core;
using NUnit.Framework;
diff --git a/GFramework.SourceGenerators/GlobalUsings.cs b/GFramework.SourceGenerators/GlobalUsings.cs
new file mode 100644
index 0000000..4d27181
--- /dev/null
+++ b/GFramework.SourceGenerators/GlobalUsings.cs
@@ -0,0 +1,18 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading;
+global using System.Threading.Tasks;
\ No newline at end of file