Create a private helper to test completions

This commit is contained in:
Dave Halter
2020-01-26 00:28:48 +01:00
parent feefd47ddd
commit 2e036bffb5

View File

@@ -40,9 +40,23 @@ def _start_linter():
raise
def _complete():
import jedi
import pdb
try:
for c in jedi.Script(sys.argv[2]).complete():
c.docstring()
c.type
except Exception:
pdb.post_mortem()
if len(sys.argv) == 2 and sys.argv[1] == 'repl':
# don't want to use __main__ only for repl yet, maybe we want to use it for
# something else. So just use the keyword ``repl`` for now.
print(join(dirname(abspath(__file__)), 'api', 'replstartup.py'))
elif len(sys.argv) > 1 and sys.argv[1] == 'linter':
_start_linter()
elif len(sys.argv) > 1 and sys.argv[1] == '_complete':
_complete()