-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathDiagnostics.cs
More file actions
64 lines (56 loc) · 3.33 KB
/
Diagnostics.cs
File metadata and controls
64 lines (56 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using Microsoft.CodeAnalysis;
namespace EntityFrameworkCore.Projectables.Generator
{
public static class Diagnostics
{
public static readonly DiagnosticDescriptor BlockBodyExperimental = new DiagnosticDescriptor(
id: "EFP0001",
title: "Block-bodied member support is experimental",
messageFormat: "Block-bodied member '{0}' is using an experimental feature. Set AllowBlockBody = true on the Projectable attribute to suppress this warning.",
category: "Design",
DiagnosticSeverity.Warning,
isEnabledByDefault: true);
public static readonly DiagnosticDescriptor NullConditionalRewriteUnsupported = new DiagnosticDescriptor(
id: "EFP0002",
title: "Method or property is not configured to support null-conditional expressions",
messageFormat: "'{0}' has a null-conditional expression exposed but is not configured to rewrite this (Consider configuring a strategy using the NullConditionalRewriteSupport property on the Projectable attribute)",
category: "Design",
DiagnosticSeverity.Error,
isEnabledByDefault: true);
public static readonly DiagnosticDescriptor UnsupportedStatementInBlockBody = new DiagnosticDescriptor(
id: "EFP0003",
title: "Unsupported statement in block-bodied method",
messageFormat: "Method '{0}' contains an unsupported statement: {1}",
category: "Design",
DiagnosticSeverity.Warning,
isEnabledByDefault: true);
public static readonly DiagnosticDescriptor SideEffectInBlockBody = new DiagnosticDescriptor(
id: "EFP0004",
title: "Statement with side effects in block-bodied method",
messageFormat: "{0}",
category: "Design",
DiagnosticSeverity.Error,
isEnabledByDefault: true);
public static readonly DiagnosticDescriptor PotentialSideEffectInBlockBody = new DiagnosticDescriptor(
id: "EFP0005",
title: "Potential side effect in block-bodied method",
messageFormat: "{0}",
category: "Design",
DiagnosticSeverity.Warning,
isEnabledByDefault: true);
public static readonly DiagnosticDescriptor RequiresBodyDefinition = new DiagnosticDescriptor(
id: "EFP0006",
title: "Method or property should expose a body definition",
messageFormat: "Method or property '{0}' should expose a body definition (e.g. an expression-bodied member or a block-bodied method) to be used as the source for the generated expression tree.",
category: "Design",
DiagnosticSeverity.Error,
isEnabledByDefault: true);
public static readonly DiagnosticDescriptor MissingParameterlessConstructor = new DiagnosticDescriptor(
id: "EFP0007",
title: "Target class is missing a parameterless constructor",
messageFormat: "Class '{0}' must have a parameterless constructor to be used with a [Projectable] constructor. The generated projection uses 'new {0}() {{ ... }}' (object-initializer syntax), which requires a publicly accessible parameterless constructor.",
category: "Design",
DiagnosticSeverity.Error,
isEnabledByDefault: true);
}
}