1
0
forked from VimPlug/jedi

Better scanning for module names, now includes namespace packages and stubs

This commit is contained in:
Dave Halter
2019-05-18 00:11:08 +02:00
parent 8e3f85c475
commit 0fb5fd271a
5 changed files with 36 additions and 28 deletions

View File

@@ -1,5 +1,3 @@
import os
from jedi.evaluate.base_context import ContextWrapper
from jedi.evaluate.context.module import ModuleContext
from jedi.evaluate.filters import ParserTreeFilter, \
@@ -61,17 +59,6 @@ class StubModuleContext(ModuleContext):
for f in filters:
yield f
def _iter_module_names(self, paths):
for path in paths:
dirs = os.listdir(path)
for name in dirs:
if os.path.isdir(os.path.join(path, name)):
if name != '__pycache__':
yield name
if name.endswith('.pyi'):
if name != '__init__.pyi':
yield name[:-4]
class TypingModuleWrapper(StubModuleContext):
def get_filters(self, *args, **kwargs):