forked from VimPlug/jedi
Remove param from get_statement_for_position.
This commit is contained in:
@@ -682,9 +682,6 @@ class FunctionExecution(Executed):
|
||||
def subscopes(self):
|
||||
return self._copy_list(self.base.subscopes)
|
||||
|
||||
def get_statement_for_position(self, pos):
|
||||
return pr.Scope.get_statement_for_position(self, pos)
|
||||
|
||||
def __repr__(self):
|
||||
return "<%s of %s>" % (type(self).__name__, self.base)
|
||||
|
||||
|
||||
@@ -552,10 +552,8 @@ class Scope(Simple, DocstringMixin):
|
||||
return True
|
||||
|
||||
@Python3Method
|
||||
def get_statement_for_position(self, pos, include_imports=False):
|
||||
checks = self.statements + self.asserts
|
||||
if include_imports:
|
||||
checks += self.imports
|
||||
def get_statement_for_position(self, pos):
|
||||
checks = self.statements + self.asserts + self.imports
|
||||
if self.isinstance(Function):
|
||||
checks += self.get_decorators()
|
||||
checks += [r for r in self.returns if r is not None]
|
||||
@@ -566,7 +564,7 @@ class Scope(Simple, DocstringMixin):
|
||||
|
||||
for s in self.subscopes:
|
||||
if s.start_pos <= pos <= s.end_pos:
|
||||
p = s.get_statement_for_position(pos, include_imports)
|
||||
p = s.get_statement_for_position(pos)
|
||||
if p:
|
||||
return p
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ class UserContextParser(object):
|
||||
def user_stmt(self):
|
||||
module = self.module()
|
||||
debug.speed('parsed')
|
||||
return module.get_statement_for_position(self._position, include_imports=True)
|
||||
return module.get_statement_for_position(self._position)
|
||||
|
||||
@cache.underscore_memoization
|
||||
def user_stmt_with_whitespace(self):
|
||||
@@ -278,7 +278,7 @@ class UserContextParser(object):
|
||||
debug.warning('No statement under the cursor.')
|
||||
return
|
||||
pos = next(self._user_context.get_context(yield_positions=True))
|
||||
user_stmt = self.module().get_statement_for_position(pos, include_imports=True)
|
||||
user_stmt = self.module().get_statement_for_position(pos)
|
||||
return user_stmt
|
||||
|
||||
@cache.underscore_memoization
|
||||
|
||||
Reference in New Issue
Block a user