forked from VimPlug/jedi
Remove get_statement_of_position. It's not used anymore
This commit is contained in:
@@ -15,7 +15,7 @@ from jedi.inference import imports
|
||||
from jedi.inference.helpers import infer_call_of_leaf, parse_dotted_names
|
||||
from jedi.inference.filters import get_global_filters
|
||||
from jedi.inference.gradual.conversion import convert_values
|
||||
from jedi.parser_utils import get_statement_of_position, cut_value_at_position
|
||||
from jedi.parser_utils import cut_value_at_position
|
||||
|
||||
|
||||
def get_call_signature_param_names(call_signatures):
|
||||
@@ -56,10 +56,8 @@ def get_user_context(module_context, position):
|
||||
"""
|
||||
Returns the scope in which the user resides. This includes flows.
|
||||
"""
|
||||
node_or_leaf = get_statement_of_position(module_context.tree_node, position)
|
||||
if node_or_leaf is None:
|
||||
node_or_leaf = module_context.tree_node.get_leaf_for_position(position, include_prefixes=True)
|
||||
return module_context.create_context(node_or_leaf)
|
||||
leaf = module_context.tree_node.get_leaf_for_position(position, include_prefixes=True)
|
||||
return module_context.create_context(leaf)
|
||||
|
||||
|
||||
def get_flow_scope_node(module_node, position):
|
||||
|
||||
@@ -94,21 +94,6 @@ def get_flow_branch_keyword(flow_node, node):
|
||||
return 0
|
||||
|
||||
|
||||
def get_statement_of_position(node, pos):
|
||||
for c in node.children:
|
||||
if c.start_pos <= pos <= c.end_pos:
|
||||
if c.type not in ('decorated', 'simple_stmt', 'suite',
|
||||
'async_stmt', 'async_funcdef') \
|
||||
and not isinstance(c, (tree.Flow, tree.ClassOrFunc)):
|
||||
return c
|
||||
else:
|
||||
try:
|
||||
return get_statement_of_position(c, pos)
|
||||
except AttributeError:
|
||||
pass # Must be a non-scope
|
||||
return None
|
||||
|
||||
|
||||
def clean_scope_docstring(scope_node):
|
||||
""" Returns a cleaned version of the docstring token. """
|
||||
node = scope_node.get_doc_node()
|
||||
|
||||
Reference in New Issue
Block a user