Alchemy/Alchemy.SourceGenerator/DiagnosticDescriptors.cs

36 lines
1.4 KiB
C#
Raw Permalink Normal View History

using Microsoft.CodeAnalysis;
2023-12-01 20:54:41 -05:00
namespace Alchemy.SourceGenerator
{
public static class DiagnosticDescriptors
{
const string Category = "GenerateAlchemySerializationData";
public static readonly DiagnosticDescriptor MustBePartial = new(
id: "ALCHEMY001",
title: "AlchemySerialize class must be partial.",
messageFormat: "AlchemySerialize class '{0}' must be partial.",
category: Category,
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true
);
public static readonly DiagnosticDescriptor NestedNotAllow = new(
id: "ALCHEMY002",
title: "AlchemySerialize class must not be nested type.",
messageFormat: "The AlchemySerialize class '{0}' must be not nested type.",
category: Category,
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true
);
public static readonly DiagnosticDescriptor ShouldBeNonSerialized = new(
id: "ALCHEMY003",
title: "AlchemySerializeField should be NonSerialized to avoid duplicate serialization.",
messageFormat: "AlchemySerializeField '{0}' should be NonSerialized to avoid duplicate serialization.",
category: Category,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true
);
}
2023-12-01 20:54:41 -05:00
}