Foundry.DiagnosticProvider

g Foundry.Contextual Foundry.Contextual Foundry.DiagnosticProvider Foundry.DiagnosticProvider Foundry.Contextual->Foundry.DiagnosticProvider GObject.GInterface GObject.GInterface Json.Serializable Json.Serializable GObject.GInterface->Json.Serializable GObject.Object GObject.Object GObject.Object->Foundry.Contextual Json.Serializable->Foundry.Contextual

Subclasses:

Foundry.DiagnosticTool

Methods

Inherited:

Foundry.Contextual (4), GObject.Object (37), Json.Serializable (8)

Structs:

GObject.ObjectClass (5)

diagnose (file, contents, language)

dup_name ()

dup_plugin_info ()

list_all ()

Virtual Methods

Inherited:

GObject.Object (7), Json.Serializable (5)

do_diagnose (file, contents, language)

do_dup_name ()

do_list_all ()

Properties

Inherited:

Foundry.Contextual (1)

Name

Type

Flags

Short Description

plugin-info

Peas.PluginInfo

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Foundry.Contextual

r

Class Details

class Foundry.DiagnosticProvider(**kwargs)
Bases:

Foundry.Contextual

Abstract:

Yes

Structure:

Foundry.DiagnosticProviderClass

Abstract base class for plugins to provide diagnostics.

diagnose(file, contents, language)
Parameters:
  • file (Gio.File or None) – the [iface`Gio`.File] of the underlying file, if any

  • contents (GLib.Bytes or None) – the [struct`GLib`.Bytes] of file contents, or None

  • language (str or None) – the language code such as “c”

Returns:

a Dex.Future that resolves to a Gio.ListModel of Foundry.Diagnostic.

Return type:

Dex.Future

Processes file to extract diagnostics.

dup_name()
Returns:

the name of the provider

Return type:

str

Gets a name for the provider that is expected to be displayed to users such as “Flatpak”.

dup_plugin_info()
Return type:

Peas.PluginInfo or None

list_all()
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.Diagnostic].

Return type:

Dex.Future

Lists all diagnostics known to the provider for the project.

This is useful for applications which want to show a project-wide list of diagnostics. Providers are encouraged to have this information cached rather than try to scan the whole project when requested.

For example, diagnostics for a build may include results from the most recent build request.

It is encouraged that providers update the listmodel as new diagnostics are made available.

New in version 1.1.

do_diagnose(file, contents, language) virtual
Parameters:
  • file (Gio.File or None) – the [iface`Gio`.File] of the underlying file, if any

  • contents (GLib.Bytes or None) – the [struct`GLib`.Bytes] of file contents, or None

  • language (str or None) – the language code such as “c”

Returns:

a Dex.Future that resolves to a Gio.ListModel of Foundry.Diagnostic.

Return type:

Dex.Future

Processes file to extract diagnostics.

do_dup_name() virtual
Returns:

the name of the provider

Return type:

str

Gets a name for the provider that is expected to be displayed to users such as “Flatpak”.

do_list_all() virtual
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.ListModel] of [class`Foundry`.Diagnostic].

Return type:

Dex.Future

Lists all diagnostics known to the provider for the project.

This is useful for applications which want to show a project-wide list of diagnostics. Providers are encouraged to have this information cached rather than try to scan the whole project when requested.

For example, diagnostics for a build may include results from the most recent build request.

It is encouraged that providers update the listmodel as new diagnostics are made available.

New in version 1.1.

Property Details

Foundry.DiagnosticProvider.props.plugin_info
Name:

plugin-info

Type:

Peas.PluginInfo

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY