1
0
forked from VimPlug/jedi

Fix type completions on classes

This commit is contained in:
Dave Halter
2018-09-09 15:51:42 +02:00
parent 6abd96a398
commit bd3bd2e53b
4 changed files with 24 additions and 4 deletions

View File

@@ -203,6 +203,15 @@ class ClassContext(use_metaclass(CachedMetaClass, TreeContext)):
origin_scope=origin_scope,
is_instance=is_instance
)
if not is_instance and self:
# Return completions of the meta class.
from jedi.evaluate.compiled import builtin_from_name
type_ = builtin_from_name(self.evaluator, u'type')
yield ClassFilter(
self.evaluator, self, node_context=type_,
origin_scope=origin_scope,
is_instance=is_instance
)
def is_class(self):
return True