[gnome-builder] jedi: only restrict by content if we are in interactive mode
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] jedi: only restrict by content if we are in interactive mode
- Date: Fri, 2 Oct 2015 09:26:06 +0000 (UTC)
commit 6f5359598d58484901710d56aba7a24575f1bf44
Author: Christian Hergert <christian hergert me>
Date: Fri Oct 2 01:30:13 2015 -0700
jedi: only restrict by content if we are in interactive mode
We shouldn't restrict what can show up if the user forces completion with
ctrl+space, or similar.
plugins/jedi/jedi_plugin.py | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index de71608..bad0317 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -232,20 +232,18 @@ class JediCompletionProvider(Ide.Object,
if self.thread is not None:
self.thread.cancelled = True
- def do_get_activiation(self):
- return GtkSource.CompletionActivation.INTERACTIVE
-
def do_match(self, context):
if not HAS_JEDI:
return False
- _, iter = context.get_iter()
- iter.backward_char()
- if iter.get_char() == ')':
- return False
- buffer = iter.get_buffer()
- classes = buffer.get_context_classes_at_iter(iter)
- if 'string' in classes:
- return False
+ if context.get_activation() == GtkSource.CompletionActivation.INTERACTIVE:
+ _, iter = context.get_iter()
+ iter.backward_char()
+ if iter.get_char() == ')':
+ return False
+ buffer = iter.get_buffer()
+ classes = buffer.get_context_classes_at_iter(iter)
+ if 'string' in classes or 'comment' in classes:
+ return False
return True
def do_get_info_widget(self, proposal):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]