Diagnostic

class Diagnostic

LSP compatible diagnostic structure.

Note that this does not capture the source document the diagnostic applies to, it is expected that this information is contextual and readily available without additional duplication.

Members defined in Diagnostic (12 members)

code

RW

The diagnostic’s code, which usually appear in the user interface.

code_description

RW

An optional property to describe the error code.

is_deprecated

RW

Deprecated or obsolete code.

is_unnecessary

RW

Unused or unnecessary code.

message

RW

The diagnostic’s message. It usually appears in the user interface

related_information

R

An array of related diagnostic information.

segment

RW

The segment at which the message applies, offsets are in UTF-8 characters

severity

RW

The diagnostic’s severity.

source

RW

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

__init__

__str__

append_related_information

Append new related diagnostic information.

Attributes

property code: str | str

The diagnostic’s code, which usually appear in the user interface.

property code_description: syside.CodeDescription | None

An optional property to describe the error code.

Requires the code field (above) to be present/not null.

property is_deprecated: bool

Deprecated or obsolete code.

property is_unnecessary: bool

Unused or unnecessary code.

property message: str

The diagnostic’s message. It usually appears in the user interface

property related_information: syside.ContainerView[syside.DiagnosticRelatedInformation]

An array of related diagnostic information.

E.g. when symbol-names within a scope collide all definitions can be marked via this property.

property segment: syside.DocumentSegment

The segment at which the message applies, offsets are in UTF-8 characters

property severity: syside.DiagnosticSeverity

The diagnostic’s severity.

property source: str | None

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

It usually appears in the user interface.

Methods

__init__(segment: syside.DocumentSegment, code: str | str, message: str, severity: syside.DiagnosticSeverity = DiagnosticSeverity.Error) None
__str__() str

Append new related diagnostic information.

Used in