mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-27 12:32:19 +08:00
Rename Name.get_parent_stmt to Name.get_definition, because it's not always a statement. Also start using it in the NameFinder.
This commit is contained in:
@@ -270,6 +270,9 @@ class InstanceElement(use_metaclass(CachedMetaClass, pr.Base)):
|
||||
def get_parent_until(self, *args, **kwargs):
|
||||
return pr.Simple.get_parent_until(self, *args, **kwargs)
|
||||
|
||||
def get_definition(self):
|
||||
return self.get_parent_until((pr.Statement, pr.IsScope, pr.Import))
|
||||
|
||||
def get_decorated_func(self):
|
||||
""" Needed because the InstanceElement should not be stripped """
|
||||
func = self.var.get_decorated_func()
|
||||
|
||||
Reference in New Issue
Block a user