diff --git a/jedi/utils.py b/jedi/utils.py index dba4a4e5..4c8b7c8b 100644 --- a/jedi/utils.py +++ b/jedi/utils.py @@ -70,6 +70,7 @@ def setup_readline(namespace_module=__main__): # use the "default" completion with ``getattr`` if # possible. path, dot, like = interpreter._get_completion_parts() + before = text[:len(text) - len(like)] # Shouldn't be an import statement and just a simple path # with dots. is_import = re.match('^\s*(import|from) ', text) @@ -88,11 +89,10 @@ def setup_readline(namespace_module=__main__): for n in namespaces: for name in dir(n): if name.lower().startswith(like.lower()): - self.matches.append(path + dot + name) + self.matches.append(before + name) else: completions = interpreter.completions() - before = text[:len(text) - len(like)] self.matches = [before + c.name_with_symbols for c in completions] try: diff --git a/test/completion/named_param.py b/test/completion/named_param.py index 949fe53a..8081bee2 100644 --- a/test/completion/named_param.py +++ b/test/completion/named_param.py @@ -1,5 +1,6 @@ """ named params: >>> def a(abc): pass +... >>> a(abc=3) # <- this stuff """