[gnome-builder] jedi: filter "self" from function parameters completion
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] jedi: filter "self" from function parameters completion
- Date: Tue, 13 Oct 2015 18:21:51 +0000 (UTC)
commit 19a12499b66c7edb1f61c32da6c73f8943a019dc
Author: Elad Alfassa <elad fedoraproject org>
Date: Mon Oct 5 15:56:11 2015 +0300
jedi: filter "self" from function parameters completion
It would be nice if we had a way to figure out if self is needed or not
on a case by case basis, but that's not easy, so I assume self is not
needed "most of the time" and just filter it out.
plugins/jedi/jedi_plugin.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index da5df38..a9ac2d7 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -168,6 +168,8 @@ class CompletionThread(threading.Thread):
info.gi_params = [GIParam(argument) for argument in obj.get_arguments()]
else:
info.real_type = info.type
+ if hasattr(info, 'params') and len(info.params) > 0 and info.params[0].name ==
'self':
+ del info.params[0]
completion = JediCompletionProposal(self._provider, self._context, info)
self._results.take_proposal(completion)
finally:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]