1
0
forked from VimPlug/jedi

Better is_same_class function

This commit is contained in:
Dave Halter
2018-09-13 22:41:30 +02:00
parent a646d930c8
commit 9ece2844f4
5 changed files with 77 additions and 70 deletions

View File

@@ -287,6 +287,8 @@ class StubParserTreeFilter(ParserTreeFilter):
# for all API accesses. Otherwise the user will be directed to the
# non-stub positions (see NameWithStub).
n = TreeNameDefinition(self.context, name)
if isinstance(self.context, TypingModuleWrapper):
n = TypingModuleName(n)
if len(non_stub_names):
for non_stub_name in non_stub_names:
if isinstance(non_stub_name, CompiledName):
@@ -446,7 +448,8 @@ class CompiledStubFunctionContext(_StubContextWithCompiled):
class TypingModuleWrapper(StubOnlyModuleContext):
def get_filters(self, *args, **kwargs):
# TODO should use this instead of the isinstance check
def get_filterss(self, *args, **kwargs):
filters = super(TypingModuleWrapper, self).get_filters(*args, **kwargs)
yield TypingModuleFilterWrapper(next(filters))
for f in filters: