Class CompilationDiagnostics
Helper methods for compiler diagnostics and CLI exit codes.
public static class CompilationDiagnostics
- Inheritance
-
CompilationDiagnostics
- Inherited Members
Fields
CompilerErrorExitCode
Exit code for compiler errors.
public const int CompilerErrorExitCode = 97
Field Value
ProgramIncompleteExitCode
Exit code for incomplete programs.
public const int ProgramIncompleteExitCode = 98
Field Value
Methods
FormatCompilerDiagnostic(CompilerDiagnostic, bool)
Formats a compiler diagnostic for CLI output.
public static string FormatCompilerDiagnostic(CompilerDiagnostic diagnostic, bool longMessages)
Parameters
diagnosticCompilerDiagnosticThe diagnostic to format.
longMessagesboolWhether to include full message text.
Returns
- string
The formatted diagnostic string.
SelectExitCode(IReadOnlyList<CompilerDiagnostic>)
Selects the exit code for a set of diagnostics.
public static int SelectExitCode(IReadOnlyList<CompilerDiagnostic> diagnostics)
Parameters
diagnosticsIReadOnlyList<CompilerDiagnostic>Compiler diagnostics.
Returns
- int
The exit code.