diff --git a/evaluate.py b/evaluate.py index 77e223ef..a89b7c37 100644 --- a/evaluate.py +++ b/evaluate.py @@ -314,6 +314,7 @@ class Function(object): This is also the places where the decorators are processed. """ f = self.base_func + print 'dec', f # only enter it, if has not already been processed if not self.is_decorated: @@ -346,11 +347,12 @@ class Function(object): debug.dbg('decorator end', f) if f != self.base_func and isinstance(f, parsing.Function): f = Function(f) + print 'enddec', f return f def __getattr__(self, name): if self.decorated_func == None: - raise DecoratorNotFound() + raise DecoratorNotFound('Accessed name %s in function' % name) return getattr(self.decorated_func, name) def __repr__(self): @@ -453,6 +455,7 @@ class Execution(Executable): result.append(self_name) param_dict = {} + print 'base', self.base, self.base.params for param in self.base.params: param_dict[str(param.get_name())] = param # There may be calls, which don't fit all the params, this just ignores @@ -579,6 +582,8 @@ class Execution(Executable): Call the default method with the own instance (self implements all the necessary functions). Add also the params. """ + a = self.get_params() + print 'params', a return self.get_params() + parsing.Scope._get_set_vars(self) @property diff --git a/ftest.py b/ftest.py index 9d1405f3..19a27f0d 100755 --- a/ftest.py +++ b/ftest.py @@ -8,6 +8,7 @@ functions.debug.ignored_modules = ['parsing', 'builtin'] functions.modules.builtin.module_find_path.insert(0, '.') f_name = 'functions.py' +f_name = 'parsetest.py' #f_name = 'test/completion/classes.py' import os path = os.path.join(os.getcwd(), f_name) @@ -15,7 +16,8 @@ path = os.path.join(os.getcwd(), f_name) f = open(path) code = f.read() for i in range(1): - completions = functions.complete(code, 163, 200, path) + completions = functions.complete(code, 15, 200, path) + #completions = functions.complete(code, 163, 200, path) #completions = functions.get_definitions(code, 181, 2, path) #completions = functions.complete(code, 42, 200, path) diff --git a/functions.py b/functions.py index 5706f5d8..c6928bf2 100644 --- a/functions.py +++ b/functions.py @@ -133,7 +133,7 @@ def complete(source, row, column, source_path): :param source_path: The path in the os, the current module is in. :type source_path: int - :return: list of completion objects + :return: list of Completion objects. :rtype: list """ try: diff --git a/test/completion/decorators.py b/test/completion/decorators.py index 8af008bf..50eb16eb 100644 --- a/test/completion/decorators.py +++ b/test/completion/decorators.py @@ -93,3 +93,22 @@ JustAClass().a() JustAClass.a. #? [] JustAClass().a() + +# ----------------- +# others +# ----------------- +def memoize(function): + def wrapper(*args): + if 1: + pass + else: + rv = function(*args) + return rv + return wrapper + +@memoize +def follow_statement(stmt): + return stmt + +#? int() +follow_statement(1) diff --git a/test/completion/thirdparty/jedi.py b/test/completion/thirdparty/jedi.py index 3c901cfb..9ebb923b 100644 --- a/test/completion/thirdparty/jedi.py +++ b/test/completion/thirdparty/jedi.py @@ -1,10 +1,18 @@ -import functions +from jedi import functions el = functions.complete()[0] -# has problems with that (sometimes) very deep nesting. #? ['description'] el.description #? str() el.description + + +scopes, path, dot, like = \ + functions.prepare_goto(source, row, column, + source_path, True) + +# has problems with that (sometimes) very deep nesting. +#? str() +el = scopes.