From cb3cd3022d38e79ff9fa213e6241c1013d8113fb Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 19 Nov 2018 09:58:35 +0100 Subject: [PATCH] get_signatures should automatically use the stubs if possible --- jedi/plugins/typeshed.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jedi/plugins/typeshed.py b/jedi/plugins/typeshed.py index c816e829..810eb277 100644 --- a/jedi/plugins/typeshed.py +++ b/jedi/plugins/typeshed.py @@ -410,7 +410,8 @@ class StubClassContext(_StubContextFilterMixin, ClassMixin, ContextWrapper): def __getattribute__(self, name): if name in ('py__getitem__', 'py__simple_getitem__', 'py__bases__', - 'execute_annotation', 'list_type_vars', 'define_generics'): + 'execute_annotation', 'list_type_vars', 'define_generics', + 'get_signatures'): # getitem is always done in the stub class. return getattr(self.stub_context, name) return super(StubClassContext, self).__getattribute__(name) @@ -425,6 +426,12 @@ class StubFunctionContext(FunctionMixin, ContextWrapper): def get_function_execution(self, arguments=None): return self.stub_context.get_function_execution(arguments) + def __getattribute__(self, name): + if name == 'get_signatures': + # getitem is always done in the stub class. + return getattr(self.stub_context, name) + return super(StubFunctionContext, self).__getattribute__(name) + class _StubOnlyContextMixin(object): _add_non_stubs_in_filter = False