[gnome-builder] jedi: penalize functions starting with __ such as __eq__
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] jedi: penalize functions starting with __ such as __eq__
- Date: Tue, 13 Oct 2015 18:26:31 +0000 (UTC)
commit 14a46f921cdd856a7d722f34fb1a60d77534e58a
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]