forked from VimPlug/jedi
Separate CompiledModuleContext from CompiledContext, fixes #1428
This commit is contained in:
@@ -17,7 +17,7 @@ from jedi.inference.compiled.access import _sentinel
|
||||
from jedi.inference.cache import inference_state_function_cache
|
||||
from jedi.inference.helpers import reraise_getitem_errors
|
||||
from jedi.inference.signature import BuiltinSignature
|
||||
from jedi.inference.context import CompiledContext
|
||||
from jedi.inference.context import CompiledContext, CompiledModuleContext
|
||||
|
||||
|
||||
class CheckAttribute(object):
|
||||
@@ -271,6 +271,8 @@ class CompiledObject(Value):
|
||||
return NO_VALUES
|
||||
|
||||
def _as_context(self):
|
||||
if self.parent_context is None:
|
||||
return CompiledModuleContext(self)
|
||||
return CompiledContext(self)
|
||||
|
||||
|
||||
|
||||
@@ -378,9 +378,15 @@ class CompiledContext(ValueContext):
|
||||
def get_filters(self, until_position=None, origin_scope=None):
|
||||
return self._value.get_filters()
|
||||
|
||||
|
||||
class CompiledModuleContext(CompiledContext):
|
||||
def get_value(self):
|
||||
return self._value
|
||||
|
||||
@property
|
||||
def string_names(self):
|
||||
return self._value.string_names
|
||||
|
||||
def py__file__(self):
|
||||
return self._value.py__file__()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user