[gnome-builder] libide/lsp: implement get_typed_text vfunc



commit 450f64e4d246a1308b9aeceb5b14d49bc45b4f2b
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 2 23:42:27 2022 -0700

    libide/lsp: implement get_typed_text vfunc

 src/libide/lsp/ide-lsp-completion-item.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/lsp/ide-lsp-completion-item.c b/src/libide/lsp/ide-lsp-completion-item.c
index b050608d6..515156b2c 100644
--- a/src/libide/lsp/ide-lsp-completion-item.c
+++ b/src/libide/lsp/ide-lsp-completion-item.c
@@ -38,8 +38,20 @@ struct _IdeLspCompletionItem
   guint kind;
 };
 
+static char *
+ide_lsp_completion_item_get_typed_text (GtkSourceCompletionProposal *proposal)
+{
+  return g_strdup (IDE_LSP_COMPLETION_ITEM (proposal)->label);
+}
+
+static void
+proposal_iface_init (GtkSourceCompletionProposalInterface *iface)
+{
+  iface->get_typed_text = ide_lsp_completion_item_get_typed_text;
+}
+
 G_DEFINE_FINAL_TYPE_WITH_CODE (IdeLspCompletionItem, ide_lsp_completion_item, G_TYPE_OBJECT,
-                               G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_COMPLETION_PROPOSAL, NULL))
+                               G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_COMPLETION_PROPOSAL, 
proposal_iface_init))
 
 static void
 ide_lsp_completion_item_finalize (GObject *object)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]