[gnome-builder] langserv: set text/version fields for rename operations
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] langserv: set text/version fields for rename operations
- Date: Thu, 30 Mar 2017 02:30:40 +0000 (UTC)
commit 44b08c2cb600bb41fe72b119b342afc859889cf0
Author: Christian Hergert <chergert redhat com>
Date: Wed Mar 29 20:29:59 2017 -0600
langserv: set text/version fields for rename operations
libide/langserv/ide-langserv-rename-provider.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libide/langserv/ide-langserv-rename-provider.c b/libide/langserv/ide-langserv-rename-provider.c
index 56e2b14..549a0de 100644
--- a/libide/langserv/ide-langserv-rename-provider.c
+++ b/libide/langserv/ide-langserv-rename-provider.c
@@ -256,9 +256,13 @@ ide_langserv_rename_provider_rename_async (IdeRenameProvider *provider,
IdeLangservRenameProviderPrivate *priv = ide_langserv_rename_provider_get_instance_private (self);
g_autoptr(GTask) task = NULL;
g_autoptr(GVariant) params = NULL;
+ g_autofree gchar *text = NULL;
g_autofree gchar *uri = NULL;
+ GtkTextIter begin;
+ GtkTextIter end;
IdeFile *ifile;
GFile *gfile;
+ gint64 version;
gint line;
gint column;
@@ -288,9 +292,16 @@ ide_langserv_rename_provider_rename_async (IdeRenameProvider *provider,
line = ide_source_location_get_line (location);
column = ide_source_location_get_line_offset (location);
+ version = ide_buffer_get_change_count (priv->buffer);
+
+ gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER (priv->buffer), &begin, &end);
+ text = gtk_text_buffer_get_text (GTK_TEXT_BUFFER (priv->buffer), &begin, &end, TRUE);
+
params = JSONRPC_MESSAGE_NEW (
"textDocument", "{",
"uri", JSONRPC_MESSAGE_PUT_STRING (uri),
+ "version", JSONRPC_MESSAGE_PUT_INT64 (version),
+ "text", JSONRPC_MESSAGE_PUT_STRING (text),
"}",
"position", "{",
"line", JSONRPC_MESSAGE_PUT_INT32 (line),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]