Method

LspEditoredit_text_document_async

Declaration

void
lsp_editor_edit_text_document_async (
  LspEditor* self,
  GUri* uri,
  gint64 version,
  LspTextDocumentContentChangeEvent* content_changes,
  gint content_changes_length1,
  GAsyncReadyCallback _callback_,
  void* _callback__target
)

Description

The document change notification is sent from the client to the server to signal changes to a text document. Before a client can change a text document it must claim ownership of its content using the textDocument/didOpen notification (see lsp_editor_open_text_document_async() ). In 2.0 the shape of the params has changed to include proper version numbers.

Parameters

uri

Type: GUri

The URI of the document that has been modified.

The data is owned by the caller of the method.
version

Type: gint64

The version numebr points to the version after all provided content changes have been applied.

content_changes

Type: An array of LspTextDocumentContentChangeEvent

The actual content changes. The content changes describe single state changes to the document. So if there are two content changes c1 (at array index 0) and c2 (at array index 1) for a document in state S then c1 moves the document from S to S2 and c2 from S2 to S3. So c1 is computed on the state S and c2 is computed on the state S2. To mirror the content of a document using change events use the following approach: * start with the same initial content * apply the ‘textDocument/didChange’ notifications in the order you receive them. * apply the TextDocumentContentChangeEvents in a single notification in the order you receive them.

The length of the array is specified in the content_changes_length1 argument.
The data is owned by the caller of the method.
content_changes_length1

Type: gint

No description available.

_callback_

Type: GAsyncReadyCallback

No description available.

The argument can be NULL.
_callback__target

Type: void*

No description available.

The argument can be NULL.
The data is owned by the caller of the method.