Header menu logo F# Compiler Guide

FSharpDiagnostic Type

Represents a diagnostic produced by the F# compiler

Instance members

Instance member Description

this.End

Full Usage: this.End

Returns: Position

Gets the end position for the diagnostic

Returns: Position

this.EndColumn

Full Usage: this.EndColumn

Returns: int

Gets the end column for the diagnostic

Returns: int

this.EndLine

Full Usage: this.EndLine

Returns: int

Gets the end line for the diagnostic

Returns: int

this.ErrorNumber

Full Usage: this.ErrorNumber

Returns: int

Gets the number for the diagnostic

Returns: int

this.ErrorNumberPrefix

Full Usage: this.ErrorNumberPrefix

Returns: string

Gets the number prefix for the diagnostic, usually "FS" but may differ for analyzers

Returns: string

this.ErrorNumberText

Full Usage: this.ErrorNumberText

Returns: string

Gets the full error number text e.g "FS0031"

Returns: string

this.ExtendedData

Full Usage: this.ExtendedData

Returns: IFSharpDiagnosticExtendedData option

Gets the contextually-relevant data to each particular diagnostic for things like code fixes

Returns: IFSharpDiagnosticExtendedData option

this.FileName

Full Usage: this.FileName

Returns: string

Gets the file name for the diagnostic

Returns: string

this.Message

Full Usage: this.Message

Returns: string

Gets the message for the diagnostic

Returns: string

this.Range

Full Usage: this.Range

Returns: range

Gets the range for the diagnostic

Returns: range

this.Severity

Full Usage: this.Severity

Returns: FSharpDiagnosticSeverity

Gets the severity for the diagnostic

Returns: FSharpDiagnosticSeverity

this.Start

Full Usage: this.Start

Returns: Position

Gets the start position for the diagnostic

Returns: Position

this.StartColumn

Full Usage: this.StartColumn

Returns: int

Gets the start column for the diagnostic

Returns: int

this.StartLine

Full Usage: this.StartLine

Returns: int

Gets the start line for the diagnostic

Returns: int

this.Subcategory

Full Usage: this.Subcategory

Returns: string

Gets the sub-category for the diagnostic

Returns: string

Static members

Static member Description

FSharpDiagnostic.Create(severity, message, number, range, ?numberPrefix, ?subcategory)

Full Usage: FSharpDiagnostic.Create(severity, message, number, range, ?numberPrefix, ?subcategory)

Parameters:
Returns: FSharpDiagnostic

Creates a diagnostic, e.g. for reporting from an analyzer

severity : FSharpDiagnosticSeverity
message : string
number : int
range : range
?numberPrefix : string
?subcategory : string
Returns: FSharpDiagnostic

FSharpDiagnostic.NewlineifyErrorString(message)

Full Usage: FSharpDiagnostic.NewlineifyErrorString(message)

Parameters:
    message : string

Returns: string

Newlines are recognized and replaced with (ASCII 29, the 'group separator'), which is decoded by the IDE with 'NewlineifyErrorString' back into newlines, so that multi-line errors can be displayed in QuickInfo

message : string
Returns: string

FSharpDiagnostic.NormalizeErrorString(text)

Full Usage: FSharpDiagnostic.NormalizeErrorString(text)

Parameters:
    text : string

Returns: string

Newlines are recognized and replaced with (ASCII 29, the 'group separator'), which is decoded by the IDE with 'NewlineifyErrorString' back into newlines, so that multi-line errors can be displayed in QuickInfo

text : string
Returns: string

Type something to start searching.