1
0
forked from VimPlug/jedi

Add a completion cache for numpy/tensorflow, fixes #1116

This commit is contained in:
Dave Halter
2020-01-05 13:51:49 +01:00
parent 1cdeee6519
commit bf446f2729
5 changed files with 115 additions and 25 deletions

View File

@@ -26,10 +26,10 @@ class ImplicitNamespaceValue(Value, SubModuleDictMixin):
api_type = u'module'
parent_context = None
def __init__(self, inference_state, fullname, paths):
def __init__(self, inference_state, string_names, paths):
super(ImplicitNamespaceValue, self).__init__(inference_state, parent_context=None)
self.inference_state = inference_state
self._fullname = fullname
self.string_names = string_names
self._paths = paths
def get_filters(self, origin_scope=None):
@@ -47,13 +47,13 @@ class ImplicitNamespaceValue(Value, SubModuleDictMixin):
def py__package__(self):
"""Return the fullname
"""
return self._fullname.split('.')
return self.string_names
def py__path__(self):
return self._paths
def py__name__(self):
return self._fullname
return '.'.join(self.string_names)
def is_namespace(self):
return True
@@ -68,4 +68,4 @@ class ImplicitNamespaceValue(Value, SubModuleDictMixin):
return NamespaceContext(self)
def __repr__(self):
return '<%s: %s>' % (self.__class__.__name__, self._fullname)
return '<%s: %s>' % (self.__class__.__name__, self.py__name__())