1
0
forked from VimPlug/jedi

dynamic array additions are working with list.append

This commit is contained in:
David Halter
2012-08-09 14:21:51 +02:00
parent e4b911b943
commit c6f76a15ff
7 changed files with 129 additions and 5 deletions

View File

@@ -1171,9 +1171,14 @@ def follow_call_list(call_list):
def follow_call(call):
""" Follow a call is following a function, variable, string, etc. """
scope = call.parent_stmt.parent
path = call.generate_call_list()
path = call.generate_call_path()
position = call.parent_stmt.start_pos
return follow_call_path(path, scope, position)
def follow_call_path(path, scope, position):
""" Follows a path generated by `parsing.Call.generate_call_path()` """
current = next(path)
if isinstance(current, parsing.Array):
@@ -1239,7 +1244,9 @@ def follow_path(path, scope, position=None):
if isinstance(current, parsing.Array):
# This must be an execution, either () or [].
if current.type == parsing.Array.LIST:
result = scope.get_index_types(current)
result = list(scope.get_index_types(current))
if isinstance(scope, Array):
result += dynamic.check_array_additions(scope)
elif current.type not in [parsing.Array.DICT]:
# Scope must be a class or func - make an instance or execution.
debug.dbg('exe', scope)