Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

Diagnostic

A diagnostic message that describes an error, warning or informational message that the user can take action on.
public sealed class Diagnostic

Inherits from System.Object

Diagnostics are presented to the user as the result of compilation, through the CompilationResult class's Diagnostics property.

#Nested Types

#Properties

#Code

Gets or sets the error code for this diagnostic.
public string? Code { get; set; }

Type String

Error codes help users look up documentation and categorize issues. Follows the format YS0001, YS0002, etc.

#Column Obsolete

Use Range.Start.Character

Gets the zero-indexed character number in FileName at which the issue begins.
public int Column { get }

Type Int32

#Context

Gets or sets the source text of FileName containing the issue.
public string? Context { get; set; }

Type String

#FileName

Gets or sets the path, URI or file-name that the issue occurred in.
public string FileName { get; set; }

Type String

#Line Obsolete

Use Range.Start.Line

Gets the zero-indexed line number in FileName at which the issue begins.
public int Line { get }

Type Int32

#Message

Gets or sets the description of the issue.
public string Message { get; set; }

Type String

#Range

Gets or sets the range of the file indicated by FileName that the issue occurred in.
public Range Range { get; set; }

Type Range

#Severity

Gets or sets the severity of the issue.
public DiagnosticSeverity Severity { get; set; }

Type DiagnosticSeverity

#Methods

#CreateDiagnostic(string, DiagnosticDescriptor, string[])

Creates a new Diagnostic using a DiagnosticDescriptor.
public static Diagnostic CreateDiagnostic(string fileName, DiagnosticDescriptor descriptor, params string[] args)

Parameters

  • fileNamestring
    The file where the diagnostic occurred.
  • The diagnostic descriptor defining the error code and message template.
  • argsstring[]
    Arguments to format the message template.

Returns Diagnostic: A new diagnostic instance.

#CreateDiagnostic(string, IToken, DiagnosticDescriptor, string[])

Creates a new Diagnostic using a DiagnosticDescriptor with token information.
public static Diagnostic CreateDiagnostic(string fileName, IToken token, DiagnosticDescriptor descriptor, params string[] args)

Parameters

  • fileNamestring
    The file where the diagnostic occurred.
  • tokenIToken
    The token where the diagnostic occurred.
  • The diagnostic descriptor defining the error code and message template.
  • argsstring[]
    Arguments to format the message template.

Returns Diagnostic: A new diagnostic instance.

#CreateDiagnostic(string, ParserRuleContext?, DiagnosticDescriptor, string[])

Creates a new Diagnostic using a DiagnosticDescriptor with parser context.
public static Diagnostic CreateDiagnostic(string fileName, ParserRuleContext? context, DiagnosticDescriptor descriptor, params string[] args)

Parameters

  • fileNamestring
    The file where the diagnostic occurred.
  • contextParserRuleContext?
    The parser context where the diagnostic occurred.
  • The diagnostic descriptor defining the error code and message template.
  • argsstring[]
    Arguments to format the message template.

Returns Diagnostic: A new diagnostic instance.

#CreateDiagnostic(string, Range, DiagnosticDescriptor, string[])

Creates a new Diagnostic using a DiagnosticDescriptor with range information.
public static Diagnostic CreateDiagnostic(string fileName, Range range, DiagnosticDescriptor descriptor, params string[] args)

Parameters

  • fileNamestring
    The file where the diagnostic occurred.
  • The range in the file where the diagnostic occurred.
  • The diagnostic descriptor defining the error code and message template.
  • argsstring[]
    Arguments to format the message template.

Returns Diagnostic: A new diagnostic instance.

#Equals(object)

public override bool Equals(object obj)

Parameters

  • objobject

Returns Boolean

#GetHashCode()

public override int GetHashCode()

Returns Int32

#ToString()

public override string ToString()

Returns String

Generated from Yarn Spinner for Unity 3.3.