Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Controls/src/SourceGen/AnalyzerReleases.Unshipped.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ MAUIX2001 | XamlInflation | Error | Descriptors
MAUIX2002 | XamlInflation | Error | Descriptors
MAUIX2003 | XamlInflation | Error | Descriptors
MAUIX2004 | XamlInflation | Error | Descriptors
MAUI1200 | QueryPropertyGenerator | Error | QueryPropertyClassMustBePartial
MAUI1201 | QueryPropertyGenerator | Warning | QueryPropertyNotFound
MAUI1202 | QueryPropertyGenerator | Warning | QueryPropertySetterNotPublic
MAUI1203 | QueryPropertyGenerator | Warning | QueryPropertyAttributeInvalidArguments
33 changes: 33 additions & 0 deletions src/Controls/src/SourceGen/Descriptors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,39 @@ public static class Descriptors
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true);

//QueryPropertyGenerator
public static DiagnosticDescriptor QueryPropertyClassMustBePartial = new DiagnosticDescriptor(
id: "MAUI1200",
title: "Class with QueryProperty must be partial",
messageFormat: "Class '{0}' with QueryProperty attributes must be declared as partial to allow source generation",
category: "QueryPropertyGenerator",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true);

public static DiagnosticDescriptor QueryPropertyNotFound = new DiagnosticDescriptor(
id: "MAUI1201",
title: "Property not found",
messageFormat: "Property '{0}' specified in QueryProperty attribute was not found in class '{1}'",
category: "QueryPropertyGenerator",
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true);

public static DiagnosticDescriptor QueryPropertySetterNotPublic = new DiagnosticDescriptor(
id: "MAUI1202",
title: "Property must have public setter",
messageFormat: "Property '{0}' in QueryProperty attribute must have a public setter",
category: "QueryPropertyGenerator",
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true);

public static DiagnosticDescriptor QueryPropertyAttributeInvalidArguments = new DiagnosticDescriptor(
id: "MAUI1203",
title: "QueryProperty attribute has invalid arguments",
messageFormat: "QueryProperty attribute on class '{0}' has invalid arguments - property name and query id must not be null or empty",
category: "QueryPropertyGenerator",
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true);

// public static BuildExceptionCode TypeResolution = new BuildExceptionCode("XC", 0000, nameof(TypeResolution), "");
// public static BuildExceptionCode PropertyResolution = new BuildExceptionCode("XC", 0001, nameof(PropertyResolution), "");
// public static BuildExceptionCode MissingEventHandler = new BuildExceptionCode("XC", 0002, nameof(MissingEventHandler), "");
Expand Down
Loading
Loading