forked from VimPlug/jedi
A bit of shuffling code around get_definition around.
This commit is contained in:
@@ -89,11 +89,9 @@ class TreeNameDefinition(AbstractTreeName):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def api_type(self):
|
def api_type(self):
|
||||||
definition = self.tree_name.get_definition()
|
definition = self.tree_name.get_definition(import_name_always=True)
|
||||||
if definition is None:
|
if definition is None:
|
||||||
definition = self.tree_name.parent
|
return 'statement'
|
||||||
if definition.type == 'dotted_as_name':
|
|
||||||
definition = definition.parent
|
|
||||||
return self._API_TYPES.get(definition.type, 'statement')
|
return self._API_TYPES.get(definition.type, 'statement')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class NameFinder(object):
|
|||||||
|
|
||||||
def _name_to_types(evaluator, context, tree_name):
|
def _name_to_types(evaluator, context, tree_name):
|
||||||
types = []
|
types = []
|
||||||
node = tree_name.get_definition()
|
node = tree_name.get_definition(import_name_always=True)
|
||||||
if node is None:
|
if node is None:
|
||||||
node = tree_name.parent
|
node = tree_name.parent
|
||||||
if node.type == 'global_stmt':
|
if node.type == 'global_stmt':
|
||||||
|
|||||||
Reference in New Issue
Block a user