[gnome-builder/gnome-builder-3-18] vala: use completionprovider helper to get current word



commit cc6c8ac1547d0266e4be84e87eabfeb073c8786a
Author: Christian Hergert <christian hergert me>
Date:   Mon Sep 28 07:46:36 2015 -0700

    vala: use completionprovider helper to get current word
    
    We still need to rebase this on the enw abstraction, of course.

 .../vala-pack/ide-vala-completion-provider.vala    |   21 +------------------
 1 files changed, 2 insertions(+), 19 deletions(-)
---
diff --git a/plugins/vala-pack/ide-vala-completion-provider.vala 
b/plugins/vala-pack/ide-vala-completion-provider.vala
index 5c310f5..7b54487 100644
--- a/plugins/vala-pack/ide-vala-completion-provider.vala
+++ b/plugins/vala-pack/ide-vala-completion-provider.vala
@@ -66,6 +66,8 @@ namespace Ide
                                return;
                        }
 
+                       var prefix = CompletionProvider.context_current_word (context);
+
                        begin = iter;
                        begin.set_line_offset (0);
                        var line = begin.get_slice (iter);
@@ -77,26 +79,7 @@ namespace Ide
                         */
                        if (can_replay (line)) {
                                HashTable<void*,bool> dedup = new HashTable<void*,bool> (GLib.direct_hash, 
GLib.direct_equal);
-                               Gtk.TextIter stop = iter;
-
-                               /* Move to the just inserted character. */
-                               if (!stop.starts_line ())
-                                       stop.backward_char ();
-
-                               /*
-                                * Walk backwards to locate the first character after a stop
-                                * character (anything non-alphanumeric or _).
-                                */
-                               while (!stop.starts_line () &&
-                                          (stop.get_char ().isalnum () || stop.get_char () == '_') &&
-                                          stop.backward_char ()) {
-                                       /* Do nothing */
-                               }
-                               var ch = stop.get_char ();
-                               if (!ch.isalnum () && (ch != ')') && (stop.compare (iter) < 0))
-                                       stop.forward_char ();
 
-                               var prefix = stop.get_slice (iter).strip ();
                                var downcase = prefix.down ();
                                var results = new GLib.List<Gtk.SourceCompletionProposal> ();
 


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