Skip to content

Commit 8b8abd4

Browse files
authored
Merge pull request #11325 from unoplatform/Youssef1313/improve-gen
chore: Avoid generating unnecessary using statements
2 parents 496d703 + 84aab4f commit 8b8abd4

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlCodeGeneration.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -712,22 +712,6 @@ private string GenerateGlobalResources(IEnumerable<XamlFileDefinition> files, Xa
712712

713713
writer.AppendLineIndented("// <autogenerated />");
714714
AnalyzerSuppressionsGenerator.GenerateCSharpPragmaSupressions(writer, _analyzerSuppressions);
715-
writer.AppendLineIndented("using System;");
716-
writer.AppendLineIndented("using System.Linq;");
717-
writer.AppendLineIndented("using System.Collections.Generic;");
718-
writer.AppendLineIndented("using Uno.Extensions;");
719-
writer.AppendLineIndented("using Uno;");
720-
writer.AppendLineIndented("using System.Diagnostics;");
721-
722-
//TODO Determine the list of namespaces to use
723-
writer.AppendLineIndented($"using {XamlConstants.BaseXamlNamespace};");
724-
writer.AppendLineIndented($"using {XamlConstants.Namespaces.Controls};");
725-
writer.AppendLineIndented($"using {XamlConstants.Namespaces.Data};");
726-
writer.AppendLineIndented($"using {XamlConstants.Namespaces.Documents};");
727-
writer.AppendLineIndented($"using {XamlConstants.Namespaces.Media};");
728-
writer.AppendLineIndented($"using {XamlConstants.Namespaces.MediaAnimation};");
729-
writer.AppendLineIndented($"using {_defaultNamespace};");
730-
writer.AppendLineIndented("");
731715

732716
// If a failure happens here, this means that the _isWasm was not properly set as the DefineConstants msbuild property
733717
// was not populated. This can happen when the property is set through a target with the "CreateProperty" task, and the
@@ -888,7 +872,7 @@ void RegisterForXamlFile(XamlFileDefinition file, string url)
888872
{
889873
// Declare master dictionary
890874
writer.AppendLine();
891-
writer.AppendLineIndented("internal static ResourceDictionary MasterDictionary {get; } = new ResourceDictionary();");
875+
writer.AppendLineIndented("internal static global::Windows.UI.Xaml.ResourceDictionary MasterDictionary { get; } = new global::Windows.UI.Xaml.ResourceDictionary();");
892876
}
893877

894878
// Generate all the partial methods, even if they don't exist. That avoids

0 commit comments

Comments
 (0)