From 4533dafef14b6705ec79fa18b7f5b3a4dbb9c0be Mon Sep 17 00:00:00 2001 From: JKronberger Date: Wed, 10 May 2023 15:12:24 +0200 Subject: [PATCH] add RecordDeclaration to accepted SyntaxKinds --- Weingartner.Json.Migration.Roslyn/DataContractAnalyzer.cs | 2 +- Weingartner.Json.Migration.Roslyn/MigrationHashAnalyzer.cs | 2 +- Weingartner.Json.Migration.Roslyn/MigrationMethodAnalyzer.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Weingartner.Json.Migration.Roslyn/DataContractAnalyzer.cs b/Weingartner.Json.Migration.Roslyn/DataContractAnalyzer.cs index 6aedb11..df5ee27 100644 --- a/Weingartner.Json.Migration.Roslyn/DataContractAnalyzer.cs +++ b/Weingartner.Json.Migration.Roslyn/DataContractAnalyzer.cs @@ -33,7 +33,7 @@ private static void OnCompilationStart(CompilationStartAnalysisContext context) var dataMemberAttributeType = context.Compilation.GetTypeByMetadataName(Constants.DataMemberAttributeMetadataName); if (migratableAttributeType != null) { - context.RegisterSyntaxNodeAction(nodeContext => AnalyzeCall(nodeContext, migratableAttributeType, dataContractAttributeType, dataMemberAttributeType), SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration); + context.RegisterSyntaxNodeAction(nodeContext => AnalyzeCall(nodeContext, migratableAttributeType, dataContractAttributeType, dataMemberAttributeType), SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration, SyntaxKind.RecordDeclaration); } } diff --git a/Weingartner.Json.Migration.Roslyn/MigrationHashAnalyzer.cs b/Weingartner.Json.Migration.Roslyn/MigrationHashAnalyzer.cs index bde91af..dd91ba3 100644 --- a/Weingartner.Json.Migration.Roslyn/MigrationHashAnalyzer.cs +++ b/Weingartner.Json.Migration.Roslyn/MigrationHashAnalyzer.cs @@ -51,7 +51,7 @@ private static void OnCompilationStart(CompilationStartAnalysisContext context) var dataMemberAttributeType = context.Compilation.GetTypeByMetadataName(Constants.DataMemberAttributeMetadataName); if (migratableAttributeType != null && dataMemberAttributeType != null) { - context.RegisterSyntaxNodeAction(nodeContext => AnalyzeCall(nodeContext, migratableAttributeType, dataMemberAttributeType), SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration); + context.RegisterSyntaxNodeAction(nodeContext => AnalyzeCall(nodeContext, migratableAttributeType, dataMemberAttributeType), SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration, SyntaxKind.RecordDeclaration); } } diff --git a/Weingartner.Json.Migration.Roslyn/MigrationMethodAnalyzer.cs b/Weingartner.Json.Migration.Roslyn/MigrationMethodAnalyzer.cs index 9653de0..f869824 100644 --- a/Weingartner.Json.Migration.Roslyn/MigrationMethodAnalyzer.cs +++ b/Weingartner.Json.Migration.Roslyn/MigrationMethodAnalyzer.cs @@ -35,7 +35,7 @@ private static void OnCompilationStart(CompilationStartAnalysisContext context) var migratableAttributeType = context.Compilation.GetTypeByMetadataName(Constants.MigratableAttributeMetadataName); if (migratableAttributeType != null) { - context.RegisterSyntaxNodeAction(nodeContext => AnalyzeCall(nodeContext, migratableAttributeType), SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration); + context.RegisterSyntaxNodeAction(nodeContext => AnalyzeCall(nodeContext, migratableAttributeType), SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration, SyntaxKind.RecordDeclaration); } }