Skip to content

Commit 96611a7

Browse files
committed
Changed severity of various yarn action diagnostics
Also removed YS1007 as it did the same job as YS1001. Fixes YarnSpinnerTool/IssuesDiscussion#105
1 parent 9d037ad commit 96611a7

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

Editor/Analysis/Action.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public string ToJSON()
410410
// is not
411411
var typeName = containingType.Name ?? "(anonymous)";
412412
diagnostics.Add(Diagnostic.Create(
413-
Diagnostics.YS1007ActionsMustBeInPublicTypes,
413+
Diagnostics.YS1001ActionMethodsMustBePublic,
414414
diagnosticLocation, identifier, typeName, containingType.DeclaredAccessibility));
415415
break;
416416
}

Editor/Analysis/Diagnostics.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static class Diagnostics
1515
title: $"Yarn action methods must be public",
1616
messageFormat: "YarnCommand and YarnFunction methods must be public. \"{0}\" is {1}.",
1717
category: "Yarn Spinner",
18-
defaultSeverity: DiagnosticSeverity.Warning,
18+
defaultSeverity: DiagnosticSeverity.Error,
1919
isEnabledByDefault: true,
2020
description: "[YarnCommand] and [YarnFunction] attributed methods must be public so that the codegen can reference them.",
2121
helpLinkUri: "https://docs.yarnspinner.dev/using-yarnspinner-with-unity/creating-commands-functions");
@@ -34,15 +34,15 @@ public static class Diagnostics
3434
title: $"YarnCommand methods must return a valid type",
3535
messageFormat: $"YarnCommand methods must return a valid type (either void, a coroutine, or a task). \"{{0}}\"'s return type is {{1}}.",
3636
category: "Yarn Spinner",
37-
defaultSeverity: DiagnosticSeverity.Warning,
37+
defaultSeverity: DiagnosticSeverity.Error,
3838
isEnabledByDefault: true,
3939
helpLinkUri: "https://docs.yarnspinner.dev/using-yarnspinner-with-unity/creating-commands-functions");
4040
public static readonly DiagnosticDescriptor YS1004FunctionMethodsMustHaveAValidReturnType = new DiagnosticDescriptor(
4141
"YS1004",
4242
title: $"YarnFunction methods must return a valid type",
4343
messageFormat: $"YarnFunction methods must return a valid type (either bool, string, or a numeric type). \"{{0}}\"'s return type is {{1}}.",
4444
category: "Yarn Spinner",
45-
defaultSeverity: DiagnosticSeverity.Warning,
45+
defaultSeverity: DiagnosticSeverity.Error,
4646
isEnabledByDefault: true,
4747
helpLinkUri: "https://docs.yarnspinner.dev/using-yarnspinner-with-unity/creating-commands-functions");
4848
public static readonly DiagnosticDescriptor YS1005ActionMethodsMustHaveOneActionAttribute = new DiagnosticDescriptor(
@@ -59,16 +59,7 @@ public static class Diagnostics
5959
title: $"YarnFunction methods be static",
6060
messageFormat: $"YarnFunction methods are required to be static.",
6161
category: "Yarn Spinner",
62-
defaultSeverity: DiagnosticSeverity.Warning,
63-
isEnabledByDefault: true,
64-
helpLinkUri: "https://docs.yarnspinner.dev/using-yarnspinner-with-unity/creating-commands-functions");
65-
66-
public static readonly DiagnosticDescriptor YS1007ActionsMustBeInPublicTypes = new DiagnosticDescriptor(
67-
"YS1007",
68-
title: $"Yarn action methods must be in a public type",
69-
messageFormat: "Yarn actions must be in a publicly accessible type. {0}'s containing type, {1}, is {2}.",
70-
category: "Yarn Spinner",
71-
defaultSeverity: DiagnosticSeverity.Warning,
62+
defaultSeverity: DiagnosticSeverity.Error,
7263
isEnabledByDefault: true,
7364
helpLinkUri: "https://docs.yarnspinner.dev/using-yarnspinner-with-unity/creating-commands-functions");
7465

@@ -110,8 +101,8 @@ public static class Diagnostics
110101

111102
public static readonly DiagnosticDescriptor YS1012ActionIsALambda = new DiagnosticDescriptor(
112103
"YS1012",
113-
title: "Yarn actions can be lambdas but this generally isn't recommended.",
114-
messageFormat: "Yarn actions can be lambdas but this generally isn't recommended.",
104+
title: "Yarn actions can be lambdas but this generally isn't recommended",
105+
messageFormat: "Yarn actions can be lambdas but this generally isn't recommended. Lambda based actions cannot be unregistered and are more difficult to debug",
115106
category: "Yarn Spinner",
116107
defaultSeverity: DiagnosticSeverity.Info,
117108
isEnabledByDefault: true,
-512 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)