IdeLspClient

IdeLspClient

Functions

Properties

GIOStream * io-stream Read / Write / Construct Only
gchar * root-uri Read / Write
GVariant * server-capabilities Read
IdeLspTrace trace Read / Write

Signals

Types and Values

Object Hierarchy

    GEnum
    ╰── IdeLspTrace
    GObject
    ╰── IdeObject
        ╰── IdeLspClient

Description

Functions

ide_lsp_client_new ()

IdeLspClient *
ide_lsp_client_new (GIOStream *io_stream);

ide_lsp_client_get_trace ()

IdeLspTrace
ide_lsp_client_get_trace (IdeLspClient *self);

ide_lsp_client_set_trace ()

void
ide_lsp_client_set_trace (IdeLspClient *self,
                          IdeLspTrace trace);

ide_lsp_client_get_server_capabilities ()

GVariant *
ide_lsp_client_get_server_capabilities
                               (IdeLspClient *self);

Gets the capabilities provided to us by the server after initializing.

This value is not available until after connecting and initializing the connection.

Parameters

self

a IdeLspClient

 

Returns

a GVariant that is a G_VARIANT_TYPE_VARDICT or NULL.

[transfer none][nullable]

Since: 3.36


ide_lsp_client_add_language ()

void
ide_lsp_client_add_language (IdeLspClient *self,
                             const gchar *language_id);

ide_lsp_client_set_root_uri ()

void
ide_lsp_client_set_root_uri (IdeLspClient *self,
                             const gchar *root_uri);

ide_lsp_client_start ()

void
ide_lsp_client_start (IdeLspClient *self);

ide_lsp_client_stop ()

void
ide_lsp_client_stop (IdeLspClient *self);

ide_lsp_client_call_async ()

void
ide_lsp_client_call_async (IdeLspClient *self,
                           const gchar *method,
                           GVariant *params,
                           GCancellable *cancellable,
                           GAsyncReadyCallback callback,
                           gpointer user_data);

Asynchronously queries the Language Server using the JSON-RPC protocol.

If params is floating, it's floating reference is consumed.

Parameters

self

An IdeLspClient

 

method

the method to call

 

params

An GVariant or NULL.

[nullable][transfer none]

cancellable

A cancellable or NULL.

[nullable]

callback

the callback to receive the result, or NULL

 

user_data

user data for callback

 

Since: 3.26


ide_lsp_client_call_finish ()

gboolean
ide_lsp_client_call_finish (IdeLspClient *self,
                            GAsyncResult *result,
                            GVariant **return_value,
                            GError **error);

ide_lsp_client_send_notification_async ()

void
ide_lsp_client_send_notification_async
                               (IdeLspClient *self,
                                const gchar *method,
                                GVariant *params,
                                GCancellable *cancellable,
                                GAsyncReadyCallback notificationback,
                                gpointer user_data);

Asynchronously sends a notification to the Language Server.

If params is floating, it's reference is consumed.

Parameters

self

An IdeLspClient

 

method

the method to notification

 

params

An GVariant or NULL.

[nullable][transfer none]

cancellable

A cancellable or NULL.

[nullable]

notificationback

the notificationback to receive the result, or NULL

 

user_data

user data for notificationback

 

Since: 3.26


ide_lsp_client_send_notification_finish ()

gboolean
ide_lsp_client_send_notification_finish
                               (IdeLspClient *self,
                                GAsyncResult *result,
                                GError **error);

ide_lsp_client_get_diagnostics_async ()

void
ide_lsp_client_get_diagnostics_async (IdeLspClient *self,
                                      GFile *file,
                                      GBytes *content,
                                      const gchar *lang_id,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

ide_lsp_client_get_diagnostics_finish ()

gboolean
ide_lsp_client_get_diagnostics_finish (IdeLspClient *self,
                                       GAsyncResult *result,
                                       IdeDiagnostics **diagnostics,
                                       GError **error);

Completes a request to ide_lsp_client_get_diagnostics_async().

Parameters

self

an IdeLspClient

 

result

a GAsyncResult

 

diagnostics

A location for a IdeDiagnostics or NULL.

[nullable][out]

error

A location for a GError or NULL

 

Returns

TRUE if successful and diagnostics is set, otherwise FALSE and error is set.

Types and Values

IDE_TYPE_LSP_CLIENT

#define IDE_TYPE_LSP_CLIENT (ide_lsp_client_get_type())

enum IdeLspTrace

Members

IDE_LSP_TRACE_OFF

   

IDE_LSP_TRACE_MESSAGES

   

IDE_LSP_TRACE_VERBOSE

   

struct IdeLspClientClass

struct IdeLspClientClass {
  IdeObjectClass parent_class;

  void      (*notification)          (IdeLspClient   *self,
                                      const gchar    *method,
                                      GVariant       *params);
  gboolean  (*supports_language)     (IdeLspClient   *self,
                                      const gchar    *language_id);
  void      (*published_diagnostics) (IdeLspClient   *self,
                                      GFile          *file,
                                      IdeDiagnostics *diagnostics);
  GVariant *(*load_configuration)    (IdeLspClient   *self);
  void      (*initialized)           (IdeLspClient   *self);
};

IdeLspClient

typedef struct _IdeLspClient IdeLspClient;

Property Details

The “io-stream” property

  “io-stream”                GIOStream *

The GIOStream to communicate over.

Owner: IdeLspClient

Flags: Read / Write / Construct Only


The “root-uri” property

  “root-uri”                 gchar *

The root uri the LSP should work on.

Owner: IdeLspClient

Flags: Read / Write

Default value: ""


The “server-capabilities” property

  “server-capabilities”      GVariant *

The server capabilities as provided by the server.

Owner: IdeLspClient

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL


The “trace” property

  “trace”                    IdeLspTrace

If tracing should be enabled on the peer.

Owner: IdeLspClient

Flags: Read / Write

Default value: IDE_LSP_TRACE_OFF

Signal Details

The “initialized” signal

void
user_function (IdeLspClient *idelspclient,
               gpointer      user_data)

Flags: Run Last


The “load-configuration” signal

GVariant*
user_function (IdeLspClient *self,
               gpointer      user_data)

Loads the configuration object to reply to a workspace/configuration request from the peer.

Parameters

self

a IdeLspClient

 

user_data

user data set when the signal handler was connected.

 

Returns

a GVariant containing the result or NULL to proceed to the next signal handler.

[transfer full]

Flags: Run Last

Since: 3.36


The “notification” signal

void
user_function (IdeLspClient *idelspclient,
               gchar        *arg1,
               GVariant     *arg2,
               gpointer      user_data)

Flags: Has Details


The “published-diagnostics” signal

void
user_function (IdeLspClient   *idelspclient,
               GFile          *arg1,
               IdeDiagnostics *arg2,
               gpointer        user_data)

Flags: Run Last


The “supports-language” signal

gboolean
user_function (IdeLspClient *idelspclient,
               gchar        *arg1,
               gpointer      user_data)

Flags: Run Last