You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: YarnSpinner.Compiler/Compiler.cs
+20-19Lines changed: 20 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -331,7 +331,7 @@ public static CompilationResult Compile(CompilationJob compilationJob)
331
331
// diagnostics for the affected expressions.
332
332
foreach(varconstraintinfailingConstraints)
333
333
{
334
-
diagnostics.Add(newYarn.Compiler.Diagnostic(constraint.SourceFileName,constraint.SourceContext,$"Expression failed to resolve in a reasonable time ({TypeSolverTimeLimit}). Try simplifying this expression."));
@@ -416,7 +416,7 @@ public static CompilationResult Compile(CompilationJob compilationJob)
416
416
{
417
417
varsuggestion=decl.Name.StartsWith("$")?$" For example: <<declare {decl.Name} = (initial value) >>":string.Empty;
418
418
419
-
diagnostics.Add(newDiagnostic(decl.SourceFileName,decl.Range,$"Can't determine type of {decl.Name} given its usage. Manually specify its type with a declare statement.{suggestion}"));
419
+
diagnostics.Add(newDiagnostic(decl.SourceFileName,decl.Range,$"Can't determine type of {decl.Name} given its usage. Manually specify its type with a declare statement.{suggestion}"){Code=DiagnosticDescriptor.TypeInferenceFailure.Code});
420
420
421
421
decl.Type=Types.Error;
422
422
}
@@ -452,7 +452,7 @@ public static CompilationResult Compile(CompilationJob compilationJob)
@@ -637,7 +637,7 @@ public static CompilationResult Compile(CompilationJob compilationJob)
637
637
638
638
if(declaration.DefaultValue==null)
639
639
{
640
-
diagnostics.Add(newDiagnostic($"Variable declaration{declaration.Name} (type {declaration.Type?.Name??"undefined"}) has a null default value. This is not allowed."));
vard=newDiagnostic(entry.File.Name,entry.TitleHeader,$"All nodes in the group '{entry.Node.NodeTitle}' must have a 'when' clause (use 'when: always' if you want this node to not have any conditions)");
diagnostics.Add(newDiagnostic(node.File.Name,node.Node.body(),$"Nodes must have a title"){Code="YS0011"});
911
+
diagnostics.Add(newDiagnostic(node.File.Name,node.Node.body(),$"Nodes must have a title"){Code=DiagnosticDescriptor.DuplicateNodeTitle.Code});
911
912
}
912
913
if(node.Node.title_header().Length>1)
913
914
{
914
-
diagnostics.Add(newDiagnostic(node.File.Name,node.Node.title_header()[1],$"Nodes must have a single title node"){Code="YS0011"});
915
+
diagnostics.Add(newDiagnostic(node.File.Name,node.Node.title_header()[1],$"Nodes must have a single title node"){Code=DiagnosticDescriptor.DuplicateNodeTitle.Code});
vard=newDiagnostic(entry.File.Name,entry.Node,$"Node \"{title??"(missing title)"}\" is empty and will not be included in the compiled output.",Diagnostic.DiagnosticSeverity.Warning);
diagnostics.Add(newDiagnostic($"Function {function.Key} cannot be used in Yarn Spinner scripts: parameter {paramInfo.Name} is optional, which isn't supported."));
1028
+
diagnostics.Add(DiagnosticDescriptor.InvalidLibraryFunction.Create("(unknown)",function.Key,$"parameter {paramInfo.Name} is optional, which isn't supported."));
1028
1029
continue;
1029
1030
}
1030
1031
1031
1032
if(paramInfo.IsOut)
1032
1033
{
1033
-
diagnostics.Add(newDiagnostic($"Function {function.Key} cannot be used in Yarn Spinner scripts: parameter {paramInfo.Name} is an out parameter, which isn't supported."));
1034
+
diagnostics.Add(DiagnosticDescriptor.InvalidLibraryFunction.Create("(unknown)",function.Key,$"parameter {paramInfo.Name} is an out parameter, which isn't supported."));
diagnostics.Add(newDiagnostic($"Function {function.Key} cannot be used in Yarn Spinner scripts: params array {paramInfo.Name}'s type ({paramInfo.ParameterType}) cannot be used in Yarn functions"));
1055
+
diagnostics.Add(DiagnosticDescriptor.InvalidLibraryFunction.Create("(unknown)",function.Key,$"params array {paramInfo.Name}'s type ({paramInfo.ParameterType}) cannot be used in Yarn functions"));
diagnostics.Add(newDiagnostic($"Function {function.Key} cannot be used in Yarn Spinner scripts: parameter {paramInfo.Name}'s type ({paramInfo.ParameterType}) cannot be used in Yarn functions"));
1060
+
diagnostics.Add(DiagnosticDescriptor.InvalidLibraryFunction.Create("(unknown)",function.Key,$"parameter {paramInfo.Name}'s type ({paramInfo.ParameterType}) cannot be used in Yarn functions"));
0 commit comments