forked from VimPlug/jedi
Get namespace package searches working
This commit is contained in:
@@ -353,6 +353,10 @@ class NamespaceContext(TreeContextMixin, ValueContext):
|
||||
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__()
|
||||
|
||||
|
||||
@@ -500,6 +500,15 @@ def load_module_from_path(inference_state, file_io, base_names=None):
|
||||
return module
|
||||
|
||||
|
||||
def load_namespace_from_path(inference_state, folder_io):
|
||||
import_names, is_package = sys_path.transform_path_to_dotted(
|
||||
inference_state.get_sys_path(),
|
||||
folder_io.path
|
||||
)
|
||||
from jedi.inference.value.namespace import ImplicitNamespaceValue
|
||||
return ImplicitNamespaceValue(inference_state, import_names, [folder_io.path])
|
||||
|
||||
|
||||
def follow_error_node_imports_if_possible(context, name):
|
||||
error_node = tree.search_ancestor(name, 'error_node')
|
||||
if error_node is not None:
|
||||
|
||||
Reference in New Issue
Block a user