forked from VimPlug/jedi
Better scanning for module names, now includes namespace packages and stubs
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user