forked from VimPlug/jedi
make array slicing work again
This commit is contained in:
@@ -771,14 +771,14 @@ class Array(use_metaclass(cache.CachedMetaClass, pr.Base)):
|
||||
def __init__(self, array):
|
||||
self._array = array
|
||||
|
||||
def get_index_types(self, index_call_list=None):
|
||||
def get_index_types(self, index_arr=None):
|
||||
""" Get the types of a specific index or all, if not given """
|
||||
if index_arr is not None:
|
||||
if index_arr and [x for x in index_arr if ':' in x.get_assignment_calls()]:
|
||||
# array slicing
|
||||
if index_call_list is not None:
|
||||
if index_call_list and [x for x in index_call_list if ':' in x.token_list]:
|
||||
return [self]
|
||||
|
||||
index_possibilities = self._follow_values(index_call_list)
|
||||
index_possibilities = self._follow_values(index_arr)
|
||||
if len(index_possibilities) == 1:
|
||||
# This is indexing only one element, with a fixed index number,
|
||||
# otherwise it just ignores the index (e.g. [1+1]).
|
||||
|
||||
@@ -730,6 +730,13 @@ class Statement(Simple):
|
||||
# first keyword of the first token is global -> must be a global
|
||||
return str(self.token_list[0]) == "global"
|
||||
|
||||
def get_command(self, index):
|
||||
commands = self.get_assignment_calls()
|
||||
try:
|
||||
return commands[index]
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
@property
|
||||
def assignment_details(self):
|
||||
if self._assignment_calls is None:
|
||||
|
||||
Reference in New Issue
Block a user