Fix debug info

This commit is contained in:
Dave Halter
2020-08-01 00:15:46 +02:00
parent 2c157e323e
commit 01e6e6bcf7

View File

@@ -2,7 +2,7 @@
import sys import sys
import vim import vim
from jedi_vim import PythonToVimStr from jedi_vim import PythonToVimStr, jedi
def echo(msg): def echo(msg):
@@ -32,6 +32,13 @@ def format_exc_info(exc_info=None, tb_indent=2):
return '{0}'.format(('\n' + indent).join(lines)) return '{0}'.format(('\n' + indent).join(lines))
def get_known_environments():
"""Get known Jedi environments."""
envs = list(jedi.find_virtualenvs())
envs.extend(jedi.find_system_environments())
return envs
def display_debug_info(): def display_debug_info():
echo(' - global sys.executable: `{0}`'.format(sys.executable)) echo(' - global sys.executable: `{0}`'.format(sys.executable))
echo(' - global sys.version: `{0}`'.format( echo(' - global sys.version: `{0}`'.format(
@@ -82,7 +89,7 @@ def display_debug_info():
if environment: if environment:
echo('\n##### Known environments\n\n') echo('\n##### Known environments\n\n')
for environment in jedi_vim.get_known_environments(): for environment in get_known_environments():
echo(' - {0} ({1})\n'.format( echo(' - {0} ({1})\n'.format(
environment, environment,
environment.executable, environment.executable,