IdeLspClient: Builder SDK Reference

## IdeLspClient IdeLspClient |

## Functions

IdeLspClient * | ide_lsp_client_new ()
void | ide_lsp_client_add_language ()
void | ide_lsp_client_start ()
void | ide_lsp_client_stop ()
void | ide_lsp_client_call_async ()
gboolean | ide_lsp_client_call_finish ()
void | ide_lsp_client_send_notification_async ()
gboolean | ide_lsp_client_send_notification_finish ()
void | ide_lsp_client_get_diagnostics_async ()
gboolean | ide_lsp_client_get_diagnostics_finish ()

## Properties

GIOStream * | io-stream | Read / Write / Construct Only

## Signals

void | notification | Has Details
void | published-diagnostics | Run Last
gboolean | supports-language | Run Last

## Types and Values

#define | IDE_TYPE_LSP_CLIENT
struct | IdeLspClientClass
| IdeLspClient

## Object Hierarchy

        GObject
        ╰── IdeObject
            ╰── IdeLspClient

## Description

## Functions

### ide_lsp_client_new ()

    IdeLspClient *
    ide_lsp_client_new (GIOStream *io_stream);

### ide_lsp_client_add_language ()

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

### 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())

### 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);
    };

### IdeLspClient

    typedef struct _IdeLspClient IdeLspClient;

## Property Details

### The `“io-stream”` property

      “io-stream”                GIOStream *

The GIOStream to communicate over.

Flags: Read / Write / Construct Only

## Signal Details

### 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