1
0
forked from VimPlug/jedi

Use ContextualizedNode instead of Node in get_calling_nodes

This improves working with these nodes by a lot.
This commit is contained in:
Dave Halter
2018-12-22 14:55:20 +01:00
parent ca784916bb
commit 1065768c77
4 changed files with 41 additions and 23 deletions
+3 -3
View File
@@ -36,14 +36,14 @@ class LazyUnknownContext(AbstractLazyContext):
class LazyTreeContext(AbstractLazyContext):
def __init__(self, context, node):
super(LazyTreeContext, self).__init__(node)
self._context = context
self.context = context
# We need to save the predefined names. It's an unfortunate side effect
# that needs to be tracked otherwise results will be wrong.
self._predefined_names = dict(context.predefined_names)
def infer(self):
with monkeypatch(self._context, 'predefined_names', self._predefined_names):
return self._context.eval_node(self.data)
with monkeypatch(self.context, 'predefined_names', self._predefined_names):
return self.context.eval_node(self.data)
def get_merged_lazy_context(lazy_contexts):