forked from VimPlug/jedi
get_signatures should automatically use the stubs if possible
This commit is contained in:
@@ -410,7 +410,8 @@ class StubClassContext(_StubContextFilterMixin, ClassMixin, ContextWrapper):
|
|||||||
|
|
||||||
def __getattribute__(self, name):
|
def __getattribute__(self, name):
|
||||||
if name in ('py__getitem__', 'py__simple_getitem__', 'py__bases__',
|
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.
|
# getitem is always done in the stub class.
|
||||||
return getattr(self.stub_context, name)
|
return getattr(self.stub_context, name)
|
||||||
return super(StubClassContext, self).__getattribute__(name)
|
return super(StubClassContext, self).__getattribute__(name)
|
||||||
@@ -425,6 +426,12 @@ class StubFunctionContext(FunctionMixin, ContextWrapper):
|
|||||||
def get_function_execution(self, arguments=None):
|
def get_function_execution(self, arguments=None):
|
||||||
return self.stub_context.get_function_execution(arguments)
|
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):
|
class _StubOnlyContextMixin(object):
|
||||||
_add_non_stubs_in_filter = False
|
_add_non_stubs_in_filter = False
|
||||||
|
|||||||
Reference in New Issue
Block a user