1
0
forked from VimPlug/jedi

Care better about stubs for code search

This commit is contained in:
Dave Halter
2020-03-08 13:16:06 +01:00
parent e46e1269a2
commit d3e3021a3d
4 changed files with 28 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
import os
import re
from jedi._compatibility import unicode, force_unicode, all_suffixes
from jedi.inference.cache import inference_state_method_cache
@@ -254,7 +255,9 @@ def transform_path_to_dotted(sys_path, module_path):
# is very strange and is probably a file that is called
# `.py`.
return
yield tuple(split)
# Stub folders for foo can end with foo-stubs. Just remove
# it.
yield tuple(re.sub(r'-stubs$', '', s) for s in split)
potential_solutions = tuple(iter_potential_solutions())
if not potential_solutions: