1
0
forked from VimPlug/jedi

A first iteration for file path completions

This commit is contained in:
Dave Halter
2019-08-04 13:50:23 +02:00
parent 9dd088f3db
commit fd1e6afd07
8 changed files with 121 additions and 20 deletions

19
jedi/api/file_name.py Normal file
View File

@@ -0,0 +1,19 @@
import os
from jedi.evaluate.names import AbstractArbitraryName
def file_name_completions(evaluator, string, like_name):
base_path = os.path.join(evaluator.project._path, string)
print(string, base_path)
for name in os.listdir(base_path):
if name.startswith(like_name):
path_for_name = os.path.join(base_path, name)
if os.path.isdir(path_for_name):
name += os.path.sep
yield FileName(evaluator, name)
class FileName(AbstractArbitraryName):
api_type = u'path'
is_context_name = False