[gnome-builder/wip/chergert/completion] vala: sort results after filtering



commit 30fcc68fed1a4099afc9fc5b2cfdcdb8159e253c
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 5 01:33:05 2018 -0700

    vala: sort results after filtering

 src/plugins/vala-pack/ide-vala-completion-item.vala     | 2 +-
 src/plugins/vala-pack/ide-vala-completion-provider.vala | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/vala-pack/ide-vala-completion-item.vala 
b/src/plugins/vala-pack/ide-vala-completion-item.vala
index d138d6e11..e59f6c3ce 100644
--- a/src/plugins/vala-pack/ide-vala-completion-item.vala
+++ b/src/plugins/vala-pack/ide-vala-completion-item.vala
@@ -25,7 +25,7 @@ namespace Ide
        public class ValaCompletionItem : GLib.Object, Ide.CompletionProposal
        {
                internal Vala.Symbol symbol;
-               uint priority;
+               internal uint priority;
 
                public ValaCompletionItem (Vala.Symbol symbol)
                {
diff --git a/src/plugins/vala-pack/ide-vala-completion-provider.vala 
b/src/plugins/vala-pack/ide-vala-completion-provider.vala
index f70c271c2..9a2afcddc 100644
--- a/src/plugins/vala-pack/ide-vala-completion-provider.vala
+++ b/src/plugins/vala-pack/ide-vala-completion-provider.vala
@@ -238,6 +238,10 @@ namespace Ide
                                        this.filtered.add (item);
                        }
 
+                       this.filtered.sort ((a, b) => {
+                               return (int)a.priority - (int)b.priority;
+                       });
+
                        this.items_changed (0, old_len, this.filtered.length);
                }
 


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