diff --git a/.editorconfig b/.editorconfig
index d7c6042e..be8df4c5 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -276,6 +276,21 @@ dotnet_diagnostic.S927.severity = none
# S2094: Classes should not be empty
dotnet_diagnostic.S2094.severity = none
+[{*SnapshotTest}/**.cs]
+# S2699: Tests should include assertions (false positive for analyzer tests)
+dotnet_diagnostic.S2699.severity = none
+
+###############################
+# SpreadCheetah Options #
+###############################
+[{ClassWithNoPropertiesContext.cs,NoPropertiesContext.cs}]
+# SPCH1001: Type has no properties with public getters
+dotnet_diagnostic.SPCH1001.severity = none
+
+[{CustomTypeContext.cs}]
+# SPCH1002: Type with unsupported property type
+dotnet_diagnostic.SPCH1002.severity = none
+
###############################
# Threading.Analyzers Options #
###############################
diff --git a/Directory.Packages.props b/Directory.Packages.props
index cf5c1dec..9be360e9 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -23,6 +23,7 @@
+
diff --git a/SpreadCheetah.SourceGenerator.CSharp8Test/Models/ClassWithNoPropertiesContext.cs b/SpreadCheetah.SourceGenerator.CSharp8Test/Models/ClassWithNoPropertiesContext.cs
index b6c2c06a..04698b51 100644
--- a/SpreadCheetah.SourceGenerator.CSharp8Test/Models/ClassWithNoPropertiesContext.cs
+++ b/SpreadCheetah.SourceGenerator.CSharp8Test/Models/ClassWithNoPropertiesContext.cs
@@ -3,7 +3,6 @@
namespace SpreadCheetah.SourceGenerator.CSharp8Test.Models
{
[WorksheetRow(typeof(ClassWithNoProperties))]
- [WorksheetRowGenerationOptions(SuppressWarnings = true)]
public partial class ClassWithNoPropertiesContext : WorksheetRowContext
{
}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Helpers/AnalyzerTest.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Helpers/AnalyzerTest.cs
new file mode 100644
index 00000000..6f9d0a1d
--- /dev/null
+++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Helpers/AnalyzerTest.cs
@@ -0,0 +1,25 @@
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Testing;
+using Microsoft.CodeAnalysis.Testing;
+using SpreadCheetah.SourceGeneration;
+using SpreadCheetah.SourceGenerators;
+
+namespace SpreadCheetah.SourceGenerator.SnapshotTest.Helpers;
+
+internal static class AnalyzerTest
+{
+ public static CSharpAnalyzerTest CreateContext()
+ {
+ return new CSharpAnalyzerTest
+ {
+ TestState =
+ {
+ ReferenceAssemblies = ReferenceAssemblies.Net.Net80,
+ AdditionalReferences =
+ {
+ MetadataReference.CreateFromFile(typeof(WorksheetRowAttribute).Assembly.Location)
+ }
+ }
+ };
+ }
+}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Helpers/TestHelper.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Helpers/TestHelper.cs
index 110de321..97721d31 100644
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Helpers/TestHelper.cs
+++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Helpers/TestHelper.cs
@@ -28,7 +28,6 @@ private static PortableExecutableReference[] GetAssemblyReferences()
public static SettingsTask CompileAndVerify(string source,
bool replaceEscapedLineEndings = false,
- bool onlyDiagnostics = false,
params object?[] parameters) where T : IIncrementalGenerator, new()
{
var syntaxTree = CSharpSyntaxTree.ParseText(source);
@@ -50,9 +49,6 @@ public static SettingsTask CompileAndVerify(string source,
var task = Verify(target, settings);
- if (onlyDiagnostics)
- task = task.IgnoreGeneratedResult(x => x.SourceText.ToString().Contains("public WorksheetRowTypeInfo<", StringComparison.Ordinal));
-
return parameters.Length > 0
? task.UseParameters(parameters)
: task;
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/.editorconfig b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/.editorconfig
deleted file mode 100644
index 74a55bed..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/.editorconfig
+++ /dev/null
@@ -1,5 +0,0 @@
-[*.cs]
-# CA1815: Override equals and operator equals on value types
-dotnet_diagnostic.CA1815.severity = none
-# MA0048: File name must match type name
-dotnet_diagnostic.MA0048.severity = none
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithAllSupportedTypes.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithAllSupportedTypes.cs
deleted file mode 100644
index df0f7043..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithAllSupportedTypes.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public class ClassWithAllSupportedTypes
-{
- public string StringValue { get; set; } = "";
- public string? NullableStringValue { get; set; }
- public int IntValue { get; set; }
- public int? NullableIntValue { get; set; }
- public long LongValue { get; set; }
- public long? NullableLongValue { get; set; }
- public float FloatValue { get; set; }
- public float? NullableFloatValue { get; set; }
- public double DoubleValue { get; set; }
- public double? NullableDoubleValue { get; set; }
- public decimal DecimalValue { get; set; }
- public decimal? NullableDecimalValue { get; set; }
- public DateTime DateTimeValue { get; set; }
- public DateTime? NullableDateTimeValue { get; set; }
- public bool BoolValue { get; set; }
- public bool? NullableBoolValue { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithInheritance.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithInheritance.cs
deleted file mode 100644
index 637ffda3..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithInheritance.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public class ClassWithInheritance : ClassWithSingleProperty
-{
- public string Address { get; set; } = "";
- public string Country { get; set; } = "";
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithMultipleProperties.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithMultipleProperties.cs
deleted file mode 100644
index b9e8f8fb..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithMultipleProperties.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public class ClassWithMultipleProperties
-{
- public string FirstName { get; set; } = "";
- public string? MiddleName { get; set; }
- public string LastName { get; set; } = "";
- public int Age { get; set; }
- public bool Employed { get; set; }
- public double Score { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithNoProperties.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithNoProperties.cs
deleted file mode 100644
index 264f0c04..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithNoProperties.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public class ClassWithNoProperties
-{
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithSingleProperty.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithSingleProperty.cs
deleted file mode 100644
index d7113fff..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithSingleProperty.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public class ClassWithSingleProperty
-{
- public string? Name { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithSinglePropertyAlternative.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithSinglePropertyAlternative.cs
deleted file mode 100644
index 1d3e809f..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithSinglePropertyAlternative.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.AlternativeModels;
-
-#pragma warning disable MA0048 // File name must match type name
-public class ClassWithSingleProperty
-#pragma warning restore MA0048 // File name must match type name
-{
- public string? Name { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithUnsupportedProperty.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithUnsupportedProperty.cs
deleted file mode 100644
index b2fd72d2..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ClassWithUnsupportedProperty.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public class ClassWithUnsupportedProperty
-{
- public string? Name { get; set; }
- public Uri? HomepageUri { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithColumnHeaderForAllProperties.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithColumnHeaderForAllProperties.cs
deleted file mode 100644
index 3afb0131..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithColumnHeaderForAllProperties.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.ColumnHeader;
-
-public class ClassWithColumnHeaderForAllProperties
-{
- [ColumnHeader("First name")]
- public string FirstName { get; set; } = "";
-
- [ColumnHeader("Middle name")]
- public string? MiddleName { get; set; }
-
- [ColumnHeader("Last name")]
- public string LastName { get; set; } = "";
-
- [ColumnHeader("Age")]
- public int Age { get; set; }
-
- [ColumnHeader("Employed (yes/no)")]
- public bool Employed { get; set; }
-
- [ColumnHeader("Score (decimal)")]
- public double Score { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithPropertyReferenceColumnHeaders.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithPropertyReferenceColumnHeaders.cs
deleted file mode 100644
index 69ba1cfa..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithPropertyReferenceColumnHeaders.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.ColumnHeader;
-
-public class ClassWithPropertyReferenceColumnHeaders
-{
- [ColumnHeader(typeof(ColumnHeaderResources), nameof(ColumnHeaderResources.Header_FirstName))]
- public string? FirstName { get; set; }
-
- [ColumnHeader(propertyName: nameof(ColumnHeaderResources.Header_LastName), type: typeof(ColumnHeaderResources))]
- public string? LastName { get; set; }
-
- [ColumnHeader(typeof(ColumnHeaders), nameof(ColumnHeaders.HeaderNationality))]
- public string? Nationality { get; set; }
-
- [ColumnHeader(typeof(ColumnHeaders), nameof(ColumnHeaders.HeaderAddressLine1))]
- public string? AddressLine1 { get; set; }
-
- [ColumnHeader(typeof(ColumnHeaders), nameof(ColumnHeaders.HeaderAddressLine2))]
- public string? AddressLine2 { get; set; }
-
- [ColumnHeader(typeof(ColumnHeaders), nameof(ColumnHeaders.HeaderAge))]
- public int Age { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithSpecialCharacterColumnHeaders.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithSpecialCharacterColumnHeaders.cs
deleted file mode 100644
index e269d2c0..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnHeader/ClassWithSpecialCharacterColumnHeaders.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.ColumnHeader;
-
-public class ClassWithSpecialCharacterColumnHeaders
-{
- [ColumnHeader("First name")]
- public string? FirstName { get; set; }
-
- [ColumnHeader("")]
- public string? LastName { get; set; }
-
- [ColumnHeader("Nationality (escaped characters \", \', \\)")]
- public string? Nationality { get; set; }
-
- [ColumnHeader("Address line 1 (escaped characters \r\n, \t)")]
- public string? AddressLine1 { get; set; }
-
- [ColumnHeader(@"Address line 2 (verbatim
-string: "", \)")]
- public string? AddressLine2 { get; set; }
-
- [ColumnHeader("""
- Age (
- raw
- string
- literal
- )
- """)]
- public int Age { get; set; }
-
- [ColumnHeader("Note (unicode escape sequence 🌉, \ud83d\udc4d, \xE7)")]
- public string? Note { get; set; }
-
- private const string Constant = "This is a constant";
-
- [ColumnHeader($"Note 2 (constant interpolated string: {Constant})")]
- public string? Note2 { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnOrdering/ClassWithColumnOrderForAllProperties.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnOrdering/ClassWithColumnOrderForAllProperties.cs
deleted file mode 100644
index 4da144a4..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnOrdering/ClassWithColumnOrderForAllProperties.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.ColumnOrdering;
-
-public class ClassWithColumnOrderForAllProperties
-{
- [ColumnOrder(2)]
- public string FirstName { get; set; } = "";
-
- [ColumnOrder(3)]
- public string? MiddleName { get; set; }
-
- [ColumnOrder(1)]
- public string LastName { get; set; } = "";
-
- [ColumnOrder(5)]
- public int Age { get; set; }
-
- [ColumnOrder(4)]
- public bool Employed { get; set; }
-
- [ColumnOrder(6)]
- public double Score { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnOrdering/ClassWithColumnOrderForSomeProperties.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnOrdering/ClassWithColumnOrderForSomeProperties.cs
deleted file mode 100644
index d6a3bfe4..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ColumnOrdering/ClassWithColumnOrderForSomeProperties.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.ColumnOrdering;
-
-public class ClassWithColumnOrderForSomeProperties
-{
- public string FirstName { get; set; } = "";
-
- [ColumnOrder(-1000)]
- public string? MiddleName { get; set; }
-
- public string LastName { get; set; } = "";
-
- [ColumnOrder(500)]
- public int Age { get; set; }
-
- public bool Employed { get; set; }
-
- [ColumnOrder(2)]
- public double Score { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirst.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirst.cs
deleted file mode 100644
index 64b53754..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirst.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns]
-public record RecordClass2LevelOfInheritanceInheritedColumnsFirst(string OwnProperty, bool Value, string ClassProperty)
- : RecordClassWithInheritedColumnsFirst(Value, ClassProperty);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirstParentIgnoreInheritance.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirstParentIgnoreInheritance.cs
deleted file mode 100644
index 5dbfbbe1..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirstParentIgnoreInheritance.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns]
-public record RecordClass2LevelOfInheritanceInheritedColumnsFirstParentIgnoreInheritance(
- string ClassProperty,
- string Name,
- bool Value,
- int Age)
- : RecordClassWithIgnoreInheritance(Name, Value, Age);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirstParentInheritColumnsLast.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirstParentInheritColumnsLast.cs
deleted file mode 100644
index 2507260d..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsFirstParentInheritColumnsLast.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns]
-public record RecordClass2LevelOfInheritanceInheritedColumnsFirstParentInheritColumnsLast(
- string OwnValue,
- bool Value,
- string ClassValue) :
- RecordClassWithInheritedColumnsLast(Value, ClassValue);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLast.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLast.cs
deleted file mode 100644
index ae2ec50f..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLast.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns(DefaultColumnOrder = InheritedColumnsOrder.InheritedColumnsLast)]
-public record RecordClass2LevelOfInheritanceInheritedColumnsLast(string OwnProperty, bool Value, string ClassProperty)
- : RecordClassWithInheritedColumnsFirst(Value, ClassProperty);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLastParentIgnoreInheritance.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLastParentIgnoreInheritance.cs
deleted file mode 100644
index b06104d3..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLastParentIgnoreInheritance.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns(DefaultColumnOrder = InheritedColumnsOrder.InheritedColumnsLast)]
-public record RecordClass2LevelOfInheritanceInheritedColumnsLastParentIgnoreInheritance(
- string ClassProperty,
- string Name,
- bool Value,
- int Age)
- : RecordClassWithIgnoreInheritance(Name, Value, Age);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLastParentInheritColumnsFirst.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLastParentInheritColumnsFirst.cs
deleted file mode 100644
index 32ae28a3..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClass2LevelOfInheritanceInheritedColumnsLastParentInheritColumnsFirst.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns(DefaultColumnOrder = InheritedColumnsOrder.InheritedColumnsLast)]
-public record RecordClass2LevelOfInheritanceInheritedColumnsLastParentInheritColumnsFirst(
- string OwnValue,
- bool Value,
- string ClassValue) :
- RecordClassWithInheritedColumnsLast(Value, ClassValue);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithIgnoreInheritance.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithIgnoreInheritance.cs
deleted file mode 100644
index dd8dfa7e..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithIgnoreInheritance.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-public record RecordClassWithIgnoreInheritance(string Name, bool Value, int Age)
- : RecordClassWithSingleProperty(Value);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithInheritedColumnsFirst.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithInheritedColumnsFirst.cs
deleted file mode 100644
index 56bbe1cf..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithInheritedColumnsFirst.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns]
-public record RecordClassWithInheritedColumnsFirst(bool Value, string ClassProperty)
- : RecordClassWithSingleProperty(Value);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithInheritedColumnsLast.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithInheritedColumnsLast.cs
deleted file mode 100644
index 1d24bede..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/InheritColumns/RecordClassWithInheritedColumnsLast.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-using SpreadCheetah.SourceGeneration;
-
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models.InheritColumns;
-
-[InheritColumns(DefaultColumnOrder = InheritedColumnsOrder.InheritedColumnsLast)]
-public record RecordClassWithInheritedColumnsLast(bool Value, string ClassValue) : RecordClassWithSingleProperty(Value);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ReadOnlyRecordStructWithSingleProperty.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ReadOnlyRecordStructWithSingleProperty.cs
deleted file mode 100644
index 0f6df8f0..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ReadOnlyRecordStructWithSingleProperty.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public readonly record struct ReadOnlyRecordStructWithSingleProperty(int Value);
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ReadOnlyStructWithSingleProperty.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ReadOnlyStructWithSingleProperty.cs
deleted file mode 100644
index 672028eb..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/ReadOnlyStructWithSingleProperty.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public readonly struct ReadOnlyStructWithSingleProperty
-{
- public int Value { get; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/RecordClassWithSingleProperty.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/RecordClassWithSingleProperty.cs
deleted file mode 100644
index 330a8063..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/RecordClassWithSingleProperty.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public record RecordClassWithSingleProperty(bool Value);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/RecordStructWithSingleProperty.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/RecordStructWithSingleProperty.cs
deleted file mode 100644
index 02eefe45..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/RecordStructWithSingleProperty.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public record struct RecordStructWithSingleProperty(double Value);
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/StructWithSingleProperty.cs b/SpreadCheetah.SourceGenerator.SnapshotTest/Models/StructWithSingleProperty.cs
deleted file mode 100644
index 1dafaa43..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Models/StructWithSingleProperty.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace SpreadCheetah.SourceGenerator.SnapshotTest.Models;
-
-public struct StructWithSingleProperty
-{
- public int Id { get; set; }
-}
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_CachingCorrectly.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.Caching_IncrementalSourceGeneratorCachingCorrectly.verified.txt
similarity index 75%
rename from SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_CachingCorrectly.verified.txt
rename to SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.Caching_IncrementalSourceGeneratorCachingCorrectly.verified.txt
index 61af5b68..6420f7c9 100644
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.WorksheetRowGenerator_Generate_CachingCorrectly.verified.txt
+++ b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.Caching_IncrementalSourceGeneratorCachingCorrectly.verified.txt
@@ -11,18 +11,18 @@ using System.Threading.Tasks;
namespace MyNamespace
{
- public partial class MyGenRowContext
+ public partial class MyContext
{
- private static MyGenRowContext? _default;
- public static MyGenRowContext Default => _default ??= new MyGenRowContext();
+ private static MyContext? _default;
+ public static MyContext Default => _default ??= new MyContext();
- public MyGenRowContext()
+ public MyContext()
{
}
- private WorksheetRowTypeInfo? _ClassWithSingleProperty;
- public WorksheetRowTypeInfo ClassWithSingleProperty => _ClassWithSingleProperty
- ??= WorksheetRowMetadataServices.CreateObjectInfo(
+ private WorksheetRowTypeInfo? _MyRecord;
+ public WorksheetRowTypeInfo MyRecord => _MyRecord
+ ??= WorksheetRowMetadataServices.CreateObjectInfo(
AddHeaderRow0Async, AddAsRowAsync, AddRangeAsRowsAsync, null);
private static async ValueTask AddHeaderRow0Async(SpreadCheetah.Spreadsheet spreadsheet, SpreadCheetah.Styling.StyleId? styleId, CancellationToken token)
@@ -39,7 +39,7 @@ namespace MyNamespace
}
}
- private static ValueTask AddAsRowAsync(SpreadCheetah.Spreadsheet spreadsheet, SpreadCheetah.SourceGenerator.SnapshotTest.Models.ClassWithSingleProperty? obj, CancellationToken token)
+ private static ValueTask AddAsRowAsync(SpreadCheetah.Spreadsheet spreadsheet, MyNamespace.MyRecord? obj, CancellationToken token)
{
if (spreadsheet is null)
throw new ArgumentNullException(nameof(spreadsheet));
@@ -49,7 +49,7 @@ namespace MyNamespace
}
private static ValueTask AddRangeAsRowsAsync(SpreadCheetah.Spreadsheet spreadsheet,
- IEnumerable objs,
+ IEnumerable objs,
CancellationToken token)
{
if (spreadsheet is null)
@@ -60,7 +60,7 @@ namespace MyNamespace
}
private static async ValueTask AddAsRowInternalAsync(SpreadCheetah.Spreadsheet spreadsheet,
- SpreadCheetah.SourceGenerator.SnapshotTest.Models.ClassWithSingleProperty obj,
+ MyNamespace.MyRecord obj,
CancellationToken token)
{
var cells = ArrayPool.Shared.Rent(1);
@@ -76,7 +76,7 @@ namespace MyNamespace
}
private static async ValueTask AddRangeAsRowsInternalAsync(SpreadCheetah.Spreadsheet spreadsheet,
- IEnumerable objs,
+ IEnumerable objs,
CancellationToken token)
{
var cells = ArrayPool.Shared.Rent(1);
@@ -95,7 +95,7 @@ namespace MyNamespace
}
private static ValueTask AddCellsAsRowAsync(SpreadCheetah.Spreadsheet spreadsheet,
- SpreadCheetah.SourceGenerator.SnapshotTest.Models.ClassWithSingleProperty? obj,
+ MyNamespace.MyRecord? obj,
DataCell[] cells, IReadOnlyList styleIds, CancellationToken token)
{
if (obj is null)
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellStyle_ClassWithEmptyCellStyle.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellStyle_ClassWithEmptyCellStyle.verified.txt
deleted file mode 100644
index 164f58f3..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellStyle_ClassWithEmptyCellStyle.verified.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- Diagnostics: [
- {
- Location: : (6,5)-(6,18),
- Message: '' is an invalid argument for CellStyleAttribute,
- Severity: Error,
- Descriptor: {
- Id: SPCH1006,
- Title: Invalid attribute argument,
- MessageFormat: '{0}' is an invalid argument for {1},
- Category: SpreadCheetah.SourceGenerator,
- DefaultSeverity: Error,
- IsEnabledByDefault: true
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt
deleted file mode 100644
index f10419a6..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassPropertyWithConverterAndCellValueTruncate.verified.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- Diagnostics: [
- {
- Location: : (7,19)-(7,27),
- Message: Having both the CellValueConverter and the CellValueTruncate attributes on a property is not supported,
- Severity: Error,
- Descriptor: {
- Id: SPCH1008,
- Title: Attribute combination not supported,
- MessageFormat: Having both the {0} and the {1} attributes on a property is not supported,
- Category: SpreadCheetah.SourceGenerator,
- DefaultSeverity: Error,
- IsEnabledByDefault: true
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt
deleted file mode 100644
index 82c21879..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithConverterThatDoesNotInheritCellValueConverter.verified.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- Diagnostics: [
- {
- Location: : (5,5)-(5,54),
- Message: Type 'MyNamespace.DecimalValueConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter,
- Severity: Error,
- Descriptor: {
- Id: SPCH1007,
- Title: Invalid attribute type argument,
- MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2},
- Category: SpreadCheetah.SourceGenerator,
- DefaultSeverity: Error,
- IsEnabledByDefault: true
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt
deleted file mode 100644
index 20ec0df3..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverter.verified.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- Diagnostics: [
- {
- Location: : (5,5)-(5,54),
- Message: Type 'MyNamespace.DecimalValueConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter,
- Severity: Error,
- Descriptor: {
- Id: SPCH1007,
- Title: Invalid attribute type argument,
- MessageFormat: Type '{0}' is an invalid argument for {1} because it does not inherit {2},
- Category: SpreadCheetah.SourceGenerator,
- DefaultSeverity: Error,
- IsEnabledByDefault: true
- }
- }
- ]
-}
\ No newline at end of file
diff --git a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverterOnComplexProperty.verified.txt b/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverterOnComplexProperty.verified.txt
deleted file mode 100644
index b01ad937..00000000
--- a/SpreadCheetah.SourceGenerator.SnapshotTest/Snapshots/G.CellValueConverter_ClassWithInvalidConverterOnComplexProperty.verified.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- Diagnostics: [
- {
- Location: : (5,5)-(5,48),
- Message: Type 'MyNamespace.StringConverter' is an invalid argument for CellValueConverterAttribute because it does not inherit CellValueConverter