mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-30 18:25:22 +08:00
A bit of shuffling code around get_definition around.
This commit is contained in:
@@ -89,11 +89,9 @@ class TreeNameDefinition(AbstractTreeName):
|
||||
|
||||
@property
|
||||
def api_type(self):
|
||||
definition = self.tree_name.get_definition()
|
||||
definition = self.tree_name.get_definition(import_name_always=True)
|
||||
if definition is None:
|
||||
definition = self.tree_name.parent
|
||||
if definition.type == 'dotted_as_name':
|
||||
definition = definition.parent
|
||||
return 'statement'
|
||||
return self._API_TYPES.get(definition.type, 'statement')
|
||||
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ class NameFinder(object):
|
||||
|
||||
def _name_to_types(evaluator, context, tree_name):
|
||||
types = []
|
||||
node = tree_name.get_definition()
|
||||
node = tree_name.get_definition(import_name_always=True)
|
||||
if node is None:
|
||||
node = tree_name.parent
|
||||
if node.type == 'global_stmt':
|
||||
|
||||
Reference in New Issue
Block a user