1
0
forked from VimPlug/jedi

completions should also have the parent attribute -> move parent to BaseDefinition

This commit is contained in:
Dave Halter
2014-04-07 00:53:34 +02:00
parent 79e2ec85cc
commit 6ebc40792a

View File

@@ -339,6 +339,11 @@ class BaseDefinition(object):
return []
return [_Param(self._evaluator, p) for p in params]
def parent(self):
scope = self._definition.get_parent_until(pr.IsScope, include_current=False)
non_flow = scope.get_parent_until(pr.Flow, reverse=True)
return Definition(self._evaluator, non_flow)
def __repr__(self):
return "<%s %s>" % (type(self).__name__, self.description)
@@ -632,11 +637,6 @@ class Definition(use_metaclass(CachedMetaClass, BaseDefinition)):
iterable = list(iterable)
return list(chain.from_iterable(iterable))
def parent(self):
scope = self._definition.get_parent_until(pr.IsScope, include_current=False)
non_flow = scope.get_parent_until(pr.Flow, reverse=True)
return Definition(self._evaluator, non_flow)
class CallSignature(Definition):
"""