From 9c6dae1df83d4604ef0c674f35a59a0929df6f12 Mon Sep 17 00:00:00 2001 From: David Halter Date: Sun, 1 Sep 2013 23:54:15 +0430 Subject: [PATCH] temporarily disable old tests to refactor set_vars --- jedi/evaluate.py | 2 +- jedi/parsing_representation.py | 11 +---------- test/completion/classes.py | 6 +++++- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/jedi/evaluate.py b/jedi/evaluate.py index 5e5f77ed..f7f183ad 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -99,7 +99,7 @@ def get_defined_names_for_position(scope, position=None, start_scope=None): :type scope: :class:`parsing_representation.IsScope` :param scope: Scope in which names are searched. - :param position: the position as a line/column tuple, default is infinity. + :param position: The position as a line/column tuple, default is infinity. """ names = scope.get_defined_names() # Instances have special rules, always return all the possible completions, diff --git a/jedi/parsing_representation.py b/jedi/parsing_representation.py index 3bffa084..711fd53a 100644 --- a/jedi/parsing_representation.py +++ b/jedi/parsing_representation.py @@ -796,8 +796,6 @@ class Statement(Simple): if not set_vars: return [] - if _assignment_details(): - s result = set(set_vars) last = None in_lookup = 0 @@ -808,16 +806,10 @@ class Statement(Simple): result.discard(tok) elif isinstance(tok, tuple): tok = tok[1] - if in_lookup == 0 and tok == '(': - is_execution = True - for t in self.token_list[:i]: - result.discard(t) if tok in '[(' and isinstance(last, Name): in_lookup += 1 elif tok in ')]' and in_lookup > 0: in_lookup -= 1 - elif '=' in tok and in_lookup == 0: - break last = tok return list(result) @@ -863,8 +855,7 @@ class Statement(Simple): def get_commands(self): if self._commands is None: self._commands = ['time neeeeed'] # avoid recursions - result = self._parse_statement() - self._commands = result + self._commands = self._parse_statement() return self._commands def _parse_statement(self): diff --git a/test/completion/classes.py b/test/completion/classes.py index ca454b7b..a0bbaba4 100644 --- a/test/completion/classes.py +++ b/test/completion/classes.py @@ -126,8 +126,12 @@ class A(): #? int() A().addition -#? 8 int() +# should also work before `=` +##? 8 int() A().addition = None +a = A() +##? 8 int() +a.addition = None # -----------------