Skip to content

Commit

Permalink
Merge pull request #24 from tchelidze/fix/#23-error-IDE0005-for-gener…
Browse files Browse the repository at this point in the history
…ated-files

Move <auto-generated/> at the top of the file, so that analyzer recognizes it as generated code
  • Loading branch information
affederaffe authored Jul 17, 2024
2 parents 6bf293e + d1431db commit e2e327a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Tmds.DBus.SourceGenerator/DBusSourceGenerator.Classes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ private static MethodDeclarationSyntax MakeWriteObjectPathSafeMethod() =>
.WithSemicolonToken(Token(SyntaxKind.SemicolonToken));

private const string SignalHelperClass = """
// <auto-generated/>
using System;
using System.Threading.Tasks;
using Tmds.DBus.Protocol;
// <auto-generated/>
#pragma warning disable
#nullable enable
namespace Tmds.DBus.SourceGenerator
Expand Down Expand Up @@ -107,9 +107,9 @@ public static ValueTask<IDisposable> WatchPropertiesChangedAsync<T>(Connection c
""";

private const string PropertyChangesClass = """
// <auto-generated/>
using System;
// <auto-generated/>
#pragma warning disable
#nullable enable
namespace Tmds.DBus.SourceGenerator
Expand All @@ -124,12 +124,12 @@ internal record PropertyChanges<TProperties>(TProperties Properties, string[] In
""";

private const string DBusInterfaceHandlerInterface = """
// <auto-generated/>
using System;
using System.Threading.Tasks;
using Tmds.DBus.Protocol;
// <auto-generated/>
#pragma warning disable
#nullable enable
namespace Tmds.DBus.SourceGenerator
Expand Down Expand Up @@ -157,13 +157,13 @@ internal interface IDBusInterfaceHandler
""";

private const string PathHandlerClass = """
// <auto-generated/>
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Tmds.DBus.Protocol;
// <auto-generated/>
#pragma warning disable
#nullable enable
namespace Tmds.DBus.SourceGenerator
Expand Down
2 changes: 1 addition & 1 deletion Tmds.DBus.SourceGenerator/DBusSourceGenerator.Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ private static CompilationUnitSyntax MakeCompilationUnit(NamespaceDeclarationSyn
IdentifierName("Microsoft.Win32.SafeHandles")),
UsingDirective(
IdentifierName("Tmds.DBus.Protocol")))
.WithLeadingTrivia(Comment("// <auto-generated>"))
.AddMembers(namespaceDeclaration
.WithLeadingTrivia(
TriviaList(
Comment("// <auto-generated/>"),
Trivia(
PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true)),
Trivia(
Expand Down

0 comments on commit e2e327a

Please sign in to comment.