mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-24 22:34:22 +08:00
Create a private helper to test completions
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user