forked from VimPlug/jedi
Refactor Jedi so we use stub modules as much as possible
This commit is contained in:
@@ -200,12 +200,7 @@ class ClassMixin(FunctionAndClassMixin):
|
||||
from jedi.evaluate.compiled import builtin_from_name
|
||||
type_ = builtin_from_name(self.evaluator, u'type')
|
||||
if type_ != self:
|
||||
# Return completions of the meta class.
|
||||
yield ClassFilter(
|
||||
self.evaluator, self, node_context=type_,
|
||||
origin_scope=origin_scope,
|
||||
is_instance=is_instance
|
||||
)
|
||||
yield next(type_.get_filters())
|
||||
|
||||
|
||||
class ClassContext(use_metaclass(CachedMetaClass, ClassMixin, TreeContext)):
|
||||
|
||||
@@ -53,7 +53,7 @@ class SubModuleDictMixin(object):
|
||||
pass
|
||||
else:
|
||||
for path in method():
|
||||
mods = iter_modules([path])
|
||||
mods = self._iter_modules(path)
|
||||
for module_loader, name, is_pkg in mods:
|
||||
# It's obviously a relative import to the current module.
|
||||
names[name] = SubModuleName(self, name)
|
||||
@@ -67,6 +67,9 @@ class SubModuleDictMixin(object):
|
||||
|
||||
return names
|
||||
|
||||
def _iter_modules(self, path):
|
||||
return iter_modules([path])
|
||||
|
||||
|
||||
class ModuleMixin(SubModuleDictMixin):
|
||||
def get_filters(self, search_global=False, until_position=None, origin_scope=None):
|
||||
|
||||
Reference in New Issue
Block a user