diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index 2c4d8e0d..84f9df33 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -134,7 +134,7 @@ def get_stack_at_position(grammar, code_lines, module_node, pos): # completion. # Use Z as a prefix because it's not part of a number suffix. safeword = 'ZZZ_USER_WANTS_TO_COMPLETE_HERE_WITH_JEDI' - code = code + safeword + code = code + ' ' + safeword p = Parser(grammar._pgen_grammar, error_recovery=True) try: diff --git a/test/completion/basic.py b/test/completion/basic.py index d79a15ed..cfa18e6a 100644 --- a/test/completion/basic.py +++ b/test/completion/basic.py @@ -18,6 +18,10 @@ int(str) str.. #? [] a(0):. +#? 2 ['and', 'or', 'if', 'is', 'in', 'not'] +0x0 +#? ['and', 'or', 'if', 'is', 'in', 'not'] +1j # ----------------- # if/else/elif