diff --git a/jedi/helpers.py b/jedi/helpers.py index d57411a3..dc07d5dc 100644 --- a/jedi/helpers.py +++ b/jedi/helpers.py @@ -123,7 +123,7 @@ def search_function_definition(stmt, pos): while isinstance(call.parent, pr.Call): call = call.parent arr.parent.execution = None - return call, index, False + return call if call.type == pr.Call.NAME else None, index, False return None, 0, False diff --git a/test/completion/invalid.py b/test/completion/invalid.py index f109e14c..ad24ea41 100644 --- a/test/completion/invalid.py +++ b/test/completion/invalid.py @@ -6,9 +6,22 @@ Basically this file could change depending on the current implementation. But there should never be any errors. """ +# wait until keywords are out of definitions (pydoc function). +##? 5 +'s'() + #? ['upper'] str()).upper +# ----------------- +# funcs +# ----------------- +def asdf(a or b): # multiple param names + return a + +#? int() +asdf(2) + from a import (b def blub(): return 0 @@ -83,6 +96,10 @@ for_local for_local +# ----------------- +# list comprehensions +# ----------------- + a2 = [for a2 in [0]] #? a2[0] @@ -113,12 +130,6 @@ a[0] #? [] int()). -def asdf(a or b): # multiple param names - return a - -#? int() -asdf(2) - # ----------------- # goto # -----------------