forked from VimPlug/jedi
TreeContextWrapper -> ContextWrapper
This commit is contained in:
@@ -123,15 +123,19 @@ def iterate_contexts(contexts, contextualized_node=None, is_async=False):
|
||||
)
|
||||
|
||||
|
||||
class TreeContextWrapper(object):
|
||||
class ContextWrapper(object):
|
||||
def __init__(self, wrapped_context):
|
||||
self._wrapped_context = wrapped_context
|
||||
assert wrapped_context.tree_node
|
||||
|
||||
@safe_property
|
||||
def name(self):
|
||||
from jedi.evaluate.filters import ContextName
|
||||
return ContextName(self, self._wrapped_context.name.tree_name)
|
||||
wrapped_name = self._wrapped_context.name
|
||||
if wrapped_name.tree_name is not None:
|
||||
return ContextName(self, wrapped_name.tree_name)
|
||||
else:
|
||||
from jedi.evaluate.compiled import CompiledContextName
|
||||
return CompiledContextName(self, wrapped_name.string_name)
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self._wrapped_context, name)
|
||||
|
||||
@@ -13,7 +13,7 @@ from jedi.evaluate.arguments import AnonymousArguments
|
||||
from jedi.evaluate.filters import ParserTreeFilter, FunctionExecutionFilter, \
|
||||
ContextName, AbstractNameDefinition, ParamName
|
||||
from jedi.evaluate.base_context import ContextualizedNode, NO_CONTEXTS, \
|
||||
ContextSet, TreeContext, TreeContextWrapper
|
||||
ContextSet, TreeContext, ContextWrapper
|
||||
from jedi.evaluate.lazy_context import LazyKnownContexts, LazyKnownContext, \
|
||||
LazyTreeContext
|
||||
from jedi.evaluate.context.typing import TypeVar
|
||||
@@ -296,7 +296,7 @@ class FunctionExecutionContext(TreeContext):
|
||||
return self.get_return_values()
|
||||
|
||||
|
||||
class OverloadedFunctionContext(TreeContextWrapper):
|
||||
class OverloadedFunctionContext(ContextWrapper):
|
||||
def __init__(self, function, overloaded_functions):
|
||||
super(OverloadedFunctionContext, self).__init__(function)
|
||||
self._overloaded_functions = overloaded_functions
|
||||
|
||||
Reference in New Issue
Block a user