mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
fix a completion in dict problem
This commit is contained in:
@@ -68,6 +68,12 @@ def check_arr_index(arr, pos):
|
||||
def array_for_pos(stmt, pos, array_types=None):
|
||||
"""Searches for the array and position of a tuple"""
|
||||
def search_array(arr, pos):
|
||||
if arr.type == 'dict':
|
||||
for stmt in arr.values + arr.keys:
|
||||
new_arr, index = array_for_pos(stmt, pos, array_types)
|
||||
if new_arr is not None:
|
||||
return new_arr, index
|
||||
else:
|
||||
for i, stmt in enumerate(arr):
|
||||
new_arr, index = array_for_pos(stmt, pos, array_types)
|
||||
if new_arr is not None:
|
||||
|
||||
@@ -181,6 +181,11 @@ def f():
|
||||
|
||||
#? dict()
|
||||
f()
|
||||
|
||||
# completion within dicts
|
||||
#? 9 ['str']
|
||||
{str: str}
|
||||
|
||||
# -----------------
|
||||
# with variable as index
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user