1
0
forked from VimPlug/jedi

added magic function names to completion, fixes nothing, but makes jedi more awesome :-D

This commit is contained in:
David Halter
2012-11-30 16:27:24 +01:00
parent ff827b4335
commit 99aed7ce91
4 changed files with 180 additions and 151 deletions

View File

@@ -457,6 +457,9 @@ class Function(use_metaclass(CachedMetaClass, parsing.Base)):
return self
return self._decorated_func
def get_magic_method_names(self):
return builtin.Builtin.magic_function_names
def __getattr__(self, name):
return getattr(self.base_func, name)
@@ -1561,10 +1564,8 @@ def follow_path(path, scope, call_scope, position=None):
else:
# The function must not be decorated with something else.
if scope.isinstance(Function):
# TODO Check default function methods and return them.
result = []
result = scope.get_magic_method_names()
else:
# TODO Check magic class methods and return them also.
# This is the typical lookup while chaining things.
if filter_private_variable(scope, call_scope, current):
return []