712c417529
[READY] Improve path to python interpreter error handling YCM returns the cryptic error `YouCompleteMe unavailable: [Errno 2] No such file or directory` when the Python interpreter path used to start the server doesn't exist. See issues https://github.com/Valloric/YouCompleteMe/issues/2773 and https://github.com/Valloric/YouCompleteMe/issues/2775. This PR improves that by using the `FindExecutable` and `GetExecutable` functions from ycmd to check if the Python interpreter path exists (and is an executable) and by returning a much more helpful message if it doesn't. We use `FindExecutable` instead of `GetExecutable` on the `g:ycm_server_python_interpreter` option so that the user can specify a Python path with just the executable name (e.g. `python`, `python2`, `python3`). This also fixes a Python traceback in Vim that occurs when, after successfully starting the server, the `g:ycm_server_python_interpreter` option is set to an invalid path and the server is restarted with `:YcmRestartServer`. Steps to reproduce are: - start Vim with a working YCM; - type `:let g:ycm_server_python_interpreter = '/invalid/python/path'`; - type `:YcmRestartServer`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2787) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
client | ||
testdata | ||
__init__.py | ||
base_test.py | ||
command_test.py | ||
completion_test.py | ||
diagnostic_filter_test.py | ||
event_notification_test.py | ||
omni_completer_test.py | ||
paths_test.py | ||
postcomplete_test.py | ||
syntax_parse_test.py | ||
test_utils.py | ||
vimsupport_test.py | ||
youcompleteme_test.py |