[gnome-builder/gnome-builder-3-18] jedi: penalize functions starting with __ such as __eq__



commit 6016d81ab44494499863c3567143293bfef14d4a
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 13 11:26:21 2015 -0700

    jedi: penalize functions starting with __ such as __eq__
    
    This moves the not oftenly called functions to the bottom of the list
    where they are less likely to pollute the valuable results.

 plugins/jedi/jedi_plugin.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index 2e74609..db51a18 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -399,6 +399,9 @@ class JediCompletionProposal(Ide.CompletionItem, GtkSource.CompletionProposal):
     def do_match(self, query, casefold):
         ret, priority = Ide.CompletionItem.fuzzy_match(self.completion.name,
                                                        self.provider.current_word_lower)
+        # Penalize words that start with __ like __eq__.
+        if self.completion.name.startswith('__'):
+            priority += 1000
         self.set_priority(priority)
         return ret
 


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