mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix some test errors
This commit is contained in:
@@ -277,6 +277,9 @@ class BaseDefinition(object):
|
|||||||
return '.'.join(names)
|
return '.'.join(names)
|
||||||
|
|
||||||
def is_stub(self):
|
def is_stub(self):
|
||||||
|
if not self._name.is_context_name:
|
||||||
|
return False
|
||||||
|
|
||||||
return self._name.get_root_context().is_stub()
|
return self._name.get_root_context().is_stub()
|
||||||
|
|
||||||
def goto_assignments(self, **kwargs): # Python 2...
|
def goto_assignments(self, **kwargs): # Python 2...
|
||||||
|
|||||||
@@ -143,9 +143,10 @@ def evaluate_goto_definition(evaluator, context, leaf):
|
|||||||
if leaf.type == 'name':
|
if leaf.type == 'name':
|
||||||
# In case of a name we can just use goto_definition which does all the
|
# In case of a name we can just use goto_definition which does all the
|
||||||
# magic itself.
|
# magic itself.
|
||||||
name = TreeNameDefinition(context, leaf)
|
print(leaf.parent)
|
||||||
if leaf.parent.type in ('trailer', 'error_node'):
|
if leaf.parent.type in ('trailer', 'error_node', 'dotted_name'):
|
||||||
return evaluator.goto_definitions(context, leaf)
|
return evaluator.goto_definitions(context, leaf)
|
||||||
|
name = TreeNameDefinition(context, leaf)
|
||||||
return ContextSet.from_sets(
|
return ContextSet.from_sets(
|
||||||
name.infer() for name in convert_names([name], prefer_stubs=True)
|
name.infer() for name in convert_names([name], prefer_stubs=True)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user