forked from VimPlug/jedi
Start using ExprStmt.
This commit is contained in:
@@ -147,7 +147,7 @@ def search_call_signatures(user_stmt, position):
|
|||||||
"""
|
"""
|
||||||
debug.speed('func_call start')
|
debug.speed('func_call start')
|
||||||
call, arr, index = None, None, 0
|
call, arr, index = None, None, 0
|
||||||
if user_stmt is not None and isinstance(user_stmt, pr.Statement):
|
if user_stmt is not None and isinstance(user_stmt, pr.ExprStmt):
|
||||||
# some parts will of the statement will be removed
|
# some parts will of the statement will be removed
|
||||||
user_stmt = deep_ast_copy(user_stmt)
|
user_stmt = deep_ast_copy(user_stmt)
|
||||||
arr, index, call = call_signature_array_for_pos(user_stmt, position)
|
arr, index, call = call_signature_array_for_pos(user_stmt, position)
|
||||||
@@ -284,7 +284,7 @@ class FakeArray(pr.Array):
|
|||||||
self.values = values
|
self.values = values
|
||||||
|
|
||||||
|
|
||||||
class FakeStatement(pr.Statement):
|
class FakeStatement(pr.ExprStmt):
|
||||||
def __init__(self, expression_list, start_pos=(0, 0), parent=None):
|
def __init__(self, expression_list, start_pos=(0, 0), parent=None):
|
||||||
p = start_pos
|
p = start_pos
|
||||||
super(FakeStatement, self).__init__(FakeSubModule, expression_list, p, p)
|
super(FakeStatement, self).__init__(FakeSubModule, expression_list, p, p)
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ class InstanceElement(use_metaclass(CachedMetaClass, pr.Base)):
|
|||||||
return pr.Simple.get_parent_until(self, *args, **kwargs)
|
return pr.Simple.get_parent_until(self, *args, **kwargs)
|
||||||
|
|
||||||
def get_definition(self):
|
def get_definition(self):
|
||||||
return self.get_parent_until((pr.Statement, pr.IsScope, pr.Import))
|
return self.get_parent_until((pr.ExprStmt, pr.IsScope, pr.Import))
|
||||||
|
|
||||||
def get_decorated_func(self):
|
def get_decorated_func(self):
|
||||||
""" Needed because the InstanceElement should not be stripped """
|
""" Needed because the InstanceElement should not be stripped """
|
||||||
|
|||||||
@@ -1515,7 +1515,7 @@ class Name(Simple):
|
|||||||
|
|
||||||
def get_definition(self):
|
def get_definition(self):
|
||||||
# TODO This is way to complicated, simplify this with a new parser.
|
# TODO This is way to complicated, simplify this with a new parser.
|
||||||
return self.get_parent_until((Statement, IsScope, Import))
|
return self.get_parent_until((ExprStmt, IsScope, Import))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def end_pos(self):
|
def end_pos(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user