mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
Finding the autocompletion stack is a bit more complicated than I initially thought
Fixes #968.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user