forked from VimPlug/jedi
Small refactoring
This commit is contained in:
@@ -548,15 +548,14 @@ def tree_name_to_contexts(evaluator, context, tree_name):
|
|||||||
for name in names:
|
for name in names:
|
||||||
expr_stmt = name.parent
|
expr_stmt = name.parent
|
||||||
|
|
||||||
correct_scope = parser_utils.get_parent_scope(name) == context.tree_node
|
if expr_stmt.type == "expr_stmt" and expr_stmt.children[1].type == "annassign":
|
||||||
|
correct_scope = parser_utils.get_parent_scope(name) == context.tree_node
|
||||||
if expr_stmt.type == "expr_stmt" and expr_stmt.children[1].type == "annassign" and correct_scope:
|
if correct_scope:
|
||||||
context_set |= pep0484.evaluate_for_annotation(
|
context_set |= pep0484.evaluate_for_annotation(
|
||||||
context, expr_stmt.children[1].children[1]
|
context, expr_stmt.children[1].children[1]
|
||||||
).execute_annotation()
|
).execute_annotation()
|
||||||
|
if context_set:
|
||||||
if context_set:
|
return context_set
|
||||||
return context_set
|
|
||||||
|
|
||||||
types = []
|
types = []
|
||||||
node = tree_name.get_definition(import_name_always=True)
|
node = tree_name.get_definition(import_name_always=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user