|
|
|
@ -21,6 +21,7 @@ internal static class GeneratorContextExtensions |
|
|
|
context.Report(UnhandledErrorDescriptorId, |
|
|
|
"Unhandled exception occured while generating typed Name references. " + |
|
|
|
"Please file an issue: https://github.com/avaloniaui/Avalonia", |
|
|
|
error.Message, |
|
|
|
error.ToString()); |
|
|
|
|
|
|
|
public static void ReportNameGeneratorInvalidType(this GeneratorExecutionContext context, string typeName) => |
|
|
|
@ -28,9 +29,16 @@ internal static class GeneratorContextExtensions |
|
|
|
$"Avalonia x:Name generator was unable to generate names for type '{typeName}'. " + |
|
|
|
$"The type '{typeName}' does not exist in the assembly."); |
|
|
|
|
|
|
|
private static void Report(this GeneratorExecutionContext context, string id, string title, string message = null) => |
|
|
|
private static void Report(this GeneratorExecutionContext context, string id, string title, string message = null, string description = null) => |
|
|
|
context.ReportDiagnostic( |
|
|
|
Diagnostic.Create( |
|
|
|
new DiagnosticDescriptor(id, title, message ?? title, "Usage", DiagnosticSeverity.Error, true), |
|
|
|
new DiagnosticDescriptor( |
|
|
|
id: id, |
|
|
|
title: title, |
|
|
|
messageFormat: message ?? title, |
|
|
|
category: "Usage", |
|
|
|
defaultSeverity: DiagnosticSeverity.Error, |
|
|
|
isEnabledByDefault: true, |
|
|
|
description), |
|
|
|
Location.None)); |
|
|
|
} |
|
|
|
|