diff --git a/jedi/parsing.py b/jedi/parsing.py index 96df4a3f..54c429af 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -798,6 +798,7 @@ class Statement(Simple): is_literal = token_type in [tokenize.STRING, tokenize.NUMBER] if isinstance(tok, Name) or is_literal: + _tok = tok c_type = Call.NAME if is_literal: tok = literal_eval(tok) @@ -820,6 +821,7 @@ class Statement(Simple): call = Call(tok, c_type, start_pos, parent=result) result.add_to_current_field(call) result = call + tok = _tok elif tok in brackets.keys(): # brackets level += 1 if is_call_or_close(): @@ -873,6 +875,10 @@ class Statement(Simple): debug.warning("Brackets don't match: %s." "This is not normal behaviour." % level) + while result is not None: + result.end_pos = start_pos[0], start_pos[1] + len(tok) + result = result.parent + self._assignment_calls_calculated = True self._assignment_calls = top return top