diff --git a/jedi/parser/__init__.py b/jedi/parser/__init__.py index 5622093d..7d0253ca 100644 --- a/jedi/parser/__init__.py +++ b/jedi/parser/__init__.py @@ -82,7 +82,7 @@ class Parser(object): arr = self.scope_names_stack[-1].setdefault(new_node.value, []) arr.append(new_node) elif isinstance(new_node, pr.ClassOrFunc) \ - and raw_node[0] == pytree.python_symbols.compound_stmt: + and raw_node[0] in (pytree.python_symbols.funcdef, pytree.python_symbols.funcdef): # scope_name_stack handling n = new_node.name scope_names = self.scope_names_stack.pop() diff --git a/test/completion/functions.py b/test/completion/functions.py index ff2aa945..7be6e533 100644 --- a/test/completion/functions.py +++ b/test/completion/functions.py @@ -266,6 +266,7 @@ class Something(): def x(self, a, b=1): return a +#? int() Something().x(1)