Documentation

Diagnostic
in package

Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.

Table of Contents

Properties

$code  : int|null
The diagnostic's code. which might appear in the user interface
$codeDescription  : CodeDescription|null
An optional property to describe the error code.
$data  : mixed|null
A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.
$message  : string
The diagnostic's message.
$range  : Range
The range at which the message applies.
$relatedInformation  : array<string|int, DiagnosticRelatedInformation>|null
An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.
$severity  : int|null
The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.
$source  : string|null
A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.
$tags  : array<string|int, int>|null
Additional metadata about the diagnostic.

Methods

__construct()  : mixed

Properties

$code

The diagnostic's code. which might appear in the user interface

public int|null $code

$codeDescription

An optional property to describe the error code.

public CodeDescription|null $codeDescription
Tags
since
3.16.0

$data

A data entry field that is preserved between a `textDocument/publishDiagnostics` notification and `textDocument/codeAction` request.

public mixed|null $data
Tags
since
3.16.0

$message

The diagnostic's message.

public string $message

$relatedInformation

An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.

public array<string|int, DiagnosticRelatedInformation>|null $relatedInformation

$severity

The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.

public int|null $severity

$source

A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.

public string|null $source

$tags

Additional metadata about the diagnostic.

public array<string|int, int>|null $tags
Tags
since
3.15.0
see
DiagnosticTag

Methods

__construct()

public __construct([string|null $message = null ][, Range|null $range = null ][, int|null $code = null ][, int|null $severity = null ][, string|null $source = null ][, CodeDescription|null $codeDescription = null ][, array<string|int, int>|null $tags = null ][, array<string|int, DiagnosticRelatedInformation>|null $relatedInformation = null ][, mixed $data = null ]) : mixed
Parameters
$message : string|null = null

The diagnostic's message

$range : Range|null = null

The range at which the message applies

$code : int|null = null

The diagnostic's code

$severity : int|null = null

DiagnosticSeverity

$source : string|null = null

A human-readable string describing the source of this diagnostic

$codeDescription : CodeDescription|null = null
$tags : array<string|int, int>|null = null

Additional metadata about the diagnostic

$relatedInformation : array<string|int, DiagnosticRelatedInformation>|null = null

Related diagnostic information

$data : mixed = null

A data entry field that is preserved between a textDocument/publishDiagnostics notification and textDocument/codeAction request


        
On this page

Search results