diff --git a/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Classes.cs b/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Classes.cs index f400949..4da1154 100644 --- a/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Classes.cs +++ b/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Classes.cs @@ -70,12 +70,12 @@ private static MethodDeclarationSyntax MakeWriteObjectPathSafeMethod() => .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)); private const string SignalHelperClass = """ + // using System; using System.Threading.Tasks; using Tmds.DBus.Protocol; - // #pragma warning disable #nullable enable namespace Tmds.DBus.SourceGenerator @@ -107,9 +107,9 @@ public static ValueTask WatchPropertiesChangedAsync(Connection c """; private const string PropertyChangesClass = """ + // using System; - // #pragma warning disable #nullable enable namespace Tmds.DBus.SourceGenerator @@ -124,12 +124,12 @@ internal record PropertyChanges(TProperties Properties, string[] In """; private const string DBusInterfaceHandlerInterface = """ + // using System; using System.Threading.Tasks; using Tmds.DBus.Protocol; - // #pragma warning disable #nullable enable namespace Tmds.DBus.SourceGenerator @@ -157,13 +157,13 @@ internal interface IDBusInterfaceHandler """; private const string PathHandlerClass = """ + // using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Tmds.DBus.Protocol; - // #pragma warning disable #nullable enable namespace Tmds.DBus.SourceGenerator diff --git a/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Utils.cs b/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Utils.cs index 261b60a..9c97a07 100644 --- a/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Utils.cs +++ b/Tmds.DBus.SourceGenerator/DBusSourceGenerator.Utils.cs @@ -32,10 +32,10 @@ private static CompilationUnitSyntax MakeCompilationUnit(NamespaceDeclarationSyn IdentifierName("Microsoft.Win32.SafeHandles")), UsingDirective( IdentifierName("Tmds.DBus.Protocol"))) + .WithLeadingTrivia(Comment("// ")) .AddMembers(namespaceDeclaration .WithLeadingTrivia( TriviaList( - Comment("// "), Trivia( PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true)), Trivia(