1
0
forked from VimPlug/jedi

Differentiate between namespace and module as a type

Also fixed a bug related to implicit namespace contexts, fixes #1033.
This commit is contained in:
Dave Halter
2018-01-25 20:35:54 +01:00
parent 33c9d21e35
commit 04fba28d35
4 changed files with 12 additions and 9 deletions

View File

@@ -13,21 +13,21 @@ class ImplicitNSName(AbstractNameDefinition):
This object will prevent Jedi from raising exceptions
"""
def __init__(self, implicit_ns_context, string_name):
self.implicit_ns_context = implicit_ns_context
self.parent_context = implicit_ns_context
self.string_name = string_name
def infer(self):
return NO_CONTEXTS
def get_root_context(self):
return self.implicit_ns_context
return self.parent_context
class ImplicitNamespaceContext(TreeContext):
"""
Provides support for implicit namespace packages
"""
api_type = u'module'
api_type = u'namespace'
parent_context = None
def __init__(self, evaluator, fullname, paths):