mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-19 14:59:41 +08:00
Create a private helper to test completions
This commit is contained in:
@@ -40,9 +40,23 @@ def _start_linter():
|
|||||||
raise
|
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':
|
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
|
# 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.
|
# something else. So just use the keyword ``repl`` for now.
|
||||||
print(join(dirname(abspath(__file__)), 'api', 'replstartup.py'))
|
print(join(dirname(abspath(__file__)), 'api', 'replstartup.py'))
|
||||||
elif len(sys.argv) > 1 and sys.argv[1] == 'linter':
|
elif len(sys.argv) > 1 and sys.argv[1] == 'linter':
|
||||||
_start_linter()
|
_start_linter()
|
||||||
|
elif len(sys.argv) > 1 and sys.argv[1] == '_complete':
|
||||||
|
_complete()
|
||||||
|
|||||||
Reference in New Issue
Block a user