[gnome-builder/gnome-builder-43] plugins: tweak completion provider priorities
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-43] plugins: tweak completion provider priorities
- Date: Thu, 22 Sep 2022 02:51:02 +0000 (UTC)
commit 64b9d7cd59b2957b0c72f2bb53f5bb888423a2ba
Author: Christian Hergert <chergert redhat com>
Date: Wed Sep 21 19:49:16 2022 -0700
plugins: tweak completion provider priorities
Now that we have top-match to elevate perfect matches (like snippets) we
can lower the snippet provider priority, raising more important providers
to the top.
src/libide/lsp/ide-lsp-completion-provider.h | 2 +-
src/plugins/clang/ide-clang-completion-provider.c | 6 +-----
src/plugins/snippets/gbp-snippet-completion-provider.c | 2 +-
3 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/libide/lsp/ide-lsp-completion-provider.h b/src/libide/lsp/ide-lsp-completion-provider.h
index 3fa897489..43df819b0 100644
--- a/src/libide/lsp/ide-lsp-completion-provider.h
+++ b/src/libide/lsp/ide-lsp-completion-provider.h
@@ -31,7 +31,7 @@
G_BEGIN_DECLS
#define IDE_TYPE_LSP_COMPLETION_PROVIDER (ide_lsp_completion_provider_get_type())
-#define IDE_LSP_COMPLETION_PROVIDER_PRIORITY (-200)
+#define IDE_LSP_COMPLETION_PROVIDER_PRIORITY 1000
IDE_AVAILABLE_IN_ALL
G_DECLARE_DERIVABLE_TYPE (IdeLspCompletionProvider, ide_lsp_completion_provider, IDE,
LSP_COMPLETION_PROVIDER, IdeObject)
diff --git a/src/plugins/clang/ide-clang-completion-provider.c
b/src/plugins/clang/ide-clang-completion-provider.c
index 8ad46f5ac..d4e3c4d4b 100644
--- a/src/plugins/clang/ide-clang-completion-provider.c
+++ b/src/plugins/clang/ide-clang-completion-provider.c
@@ -74,11 +74,7 @@ static gint
ide_clang_completion_provider_get_priority (GtkSourceCompletionProvider *provider,
GtkSourceCompletionContext *context)
{
- /* Place results before snippets */
- if (is_field_access (context))
- return 5000;
-
- return 3000;
+ return 2000;
}
static gboolean
diff --git a/src/plugins/snippets/gbp-snippet-completion-provider.c
b/src/plugins/snippets/gbp-snippet-completion-provider.c
index 54b5ce1e2..0b7b9aa20 100644
--- a/src/plugins/snippets/gbp-snippet-completion-provider.c
+++ b/src/plugins/snippets/gbp-snippet-completion-provider.c
@@ -65,7 +65,7 @@ static int
gbp_snippet_completion_provider_get_priority (GtkSourceCompletionProvider *provider,
GtkSourceCompletionContext *context)
{
- return 4000;
+ return 0;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]