forked from VimPlug/jedi
get_module_names: fix "all_scopes=False" handling
Previously, names defined within the scope of first-level classes or functions were returned.
This commit is contained in:
@@ -234,6 +234,14 @@ def is_scope(node):
|
||||
return node.type in ('file_input', 'classdef', 'funcdef', 'lambdef', 'comp_for')
|
||||
|
||||
|
||||
def is_name_of_func_or_class_def(name_node, func_or_class_def_node):
|
||||
"""Return True if name_node is the name of the func_or_class_def_node."""
|
||||
return (
|
||||
name_node.parent is func_or_class_def_node and
|
||||
name_node.type == 'name' and
|
||||
func_or_class_def_node.type in ('classdef', 'funcdef'))
|
||||
|
||||
|
||||
def get_parent_scope(node, include_flows=False):
|
||||
"""
|
||||
Returns the underlying scope.
|
||||
|
||||
Reference in New Issue
Block a user