Foundry.Diagnostic

g Foundry.Diagnostic Foundry.Diagnostic GObject.Object GObject.Object GObject.Object->Foundry.Diagnostic

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

hash (data)

compare (right)

dup_file ()

dup_markup ()

dup_message ()

dup_path ()

dup_rule_id ()

equal (right)

get_line ()

get_line_offset ()

get_severity ()

has_fix ()

list_fixes ()

list_ranges ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

file

Gio.File

r

has-fix

bool

r

line

int

r

line-offset

int

r

markup

Foundry.Markup

r

message

str

r

path

str

r

ranges

Gio.ListModel

r

rule-id

str

r

severity

Foundry.DiagnosticSeverity

r

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Foundry.Diagnostic(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Foundry.DiagnosticClass

Represents a single diagnostic.

classmethod hash(data)
Parameters:

data (object or None) –

Return type:

int

compare(right)
Parameters:

right (Foundry.Diagnostic) –

Return type:

int

dup_file()
Returns:

a Gio.File or None

Return type:

Gio.File or None

dup_markup()
Return type:

Foundry.Markup or None

Get the markup for the diagnostic, if any.

dup_message()
Returns:

a message string or None

Return type:

str or None

Gets the message for the diagnostic, if any.

dup_path()
Returns:

a string or None

Return type:

str or None

Gets the path for the diagnostic, if any.

dup_rule_id()
Return type:

str or None

Gets the [property`Foundry`.Diagnostic:rule-id] property.

New in version 1.1.

equal(right)
Parameters:

right (Foundry.Diagnostic) –

Return type:

bool

get_line()
Returns:

A line number starting from 1, or 0 to indicate unset.

Return type:

int

Gets the line number of the diagnostic.

A value of 0 indicates that the line is unset.

get_line_offset()
Returns:

A character offset within the line starting from 1, or 0 to indicate unset.

Return type:

int

Gets the offset within the line of the diagnostic.

A value of 0 indicates that the line offset is unset.

get_severity()
Return type:

Foundry.DiagnosticSeverity

has_fix()
Return type:

bool

New in version 1.1.

list_fixes()
Returns:

a [iface`Gio`.ListModel] of [class`Foundry`.DiagnosticFix]

Return type:

Gio.ListModel or None

Gets the available [class`Foundry`.DiagnosticFix] for the diagnostic.

New in version 1.1.

list_ranges()
Returns:

a Gio.ListModel or None if there are no ranges associated with this diagnostic.

Return type:

Gio.ListModel

Gets the available ranges as a Gio.ListModel of Foundry.DiagnosticRange.

Property Details

Foundry.Diagnostic.props.file
Name:

file

Type:

Gio.File

Default Value:

None

Flags:

READABLE

Foundry.Diagnostic.props.has_fix
Name:

has-fix

Type:

bool

Default Value:

False

Flags:

READABLE

Foundry.Diagnostic.props.line
Name:

line

Type:

int

Default Value:

0

Flags:

READABLE

Foundry.Diagnostic.props.line_offset
Name:

line-offset

Type:

int

Default Value:

0

Flags:

READABLE

Foundry.Diagnostic.props.markup
Name:

markup

Type:

Foundry.Markup

Default Value:

None

Flags:

READABLE

Foundry.Diagnostic.props.message
Name:

message

Type:

str

Default Value:

None

Flags:

READABLE

Foundry.Diagnostic.props.path
Name:

path

Type:

str

Default Value:

None

Flags:

READABLE

Foundry.Diagnostic.props.ranges
Name:

ranges

Type:

Gio.ListModel

Default Value:

None

Flags:

READABLE

Foundry.Diagnostic.props.rule_id
Name:

rule-id

Type:

str

Default Value:

None

Flags:

READABLE

The “rule-id” property is an identifier to the type of rule for the diagnostic.

Not all diagnostics may have this, but it is generally useful to provide from diagnostic providers where a known rule is applied. For example, many compilers have a rule identifier which may be silenced by matching the value of this property.

New in version 1.1.

Foundry.Diagnostic.props.severity
Name:

severity

Type:

Foundry.DiagnosticSeverity

Default Value:

Foundry.DiagnosticSeverity.NOTE

Flags:

READABLE