From f7a384bf18dbf5dcd72eacf3b4c8a314a50bdb76 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 1 Jul 2014 12:45:34 +0200 Subject: [PATCH] fix a multi line issue of var_args with an error token or newline in the beginning. --- jedi/evaluate/param.py | 2 ++ test/completion/functions.py | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/jedi/evaluate/param.py b/jedi/evaluate/param.py index fca1a479..b5d4f183 100644 --- a/jedi/evaluate/param.py +++ b/jedi/evaluate/param.py @@ -253,6 +253,8 @@ def _unpack_var_args(evaluator, var_args, func): else: if stmt.assignment_details: key_arr, op = stmt.assignment_details[0] + # Filter error tokens + key_arr = [x for x in key_arr if isinstance(x, pr.Call)] # named parameter if key_arr and isinstance(key_arr[0], pr.Call): argument_list.append((key_arr[0].name, [stmt])) diff --git a/test/completion/functions.py b/test/completion/functions.py index 0da6d749..b9b31c3a 100644 --- a/test/completion/functions.py +++ b/test/completion/functions.py @@ -46,6 +46,15 @@ def multi_line_func(a, # comment blabla #? str() multi_line_func(1,'') +def multi_line_call(b): + return b + + +multi_line_call( +#? int() + b=1) + + # nothing after comma def asdf(a): return a