The buffer-local variable b:jedi_environment_path was added to override the global variable g:jedi#environment_path.

This commit is contained in:
James Cherti
2021-06-21 14:58:57 -04:00
parent 8763462331
commit 81e1e9ca34
2 changed files with 9 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ Contents *jedi-vim-contents*
6.13. smart_auto_mappings |g:jedi#smart_auto_mappings| 6.13. smart_auto_mappings |g:jedi#smart_auto_mappings|
6.14. use_tag_stack |g:jedi#use_tag_stack| 6.14. use_tag_stack |g:jedi#use_tag_stack|
6.15. environment_path |g:jedi#environment_path| 6.15. environment_path |g:jedi#environment_path|
|b:jedi_environment_path|
6.16. added_sys_path |g:jedi#added_sys_path| 6.16. added_sys_path |g:jedi#added_sys_path|
7. Testing |jedi-vim-testing| 7. Testing |jedi-vim-testing|
8. Contributing |jedi-vim-contributing| 8. Contributing |jedi-vim-contributing|
@@ -510,6 +511,7 @@ Default: 1 (enabled by default)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
6.15. `g:jedi#environment_path` *g:jedi#environment_path* 6.15. `g:jedi#environment_path` *g:jedi#environment_path*
*b:jedi_environment_path*
To use a specific virtualenv or a specific Python version it is possible to To use a specific virtualenv or a specific Python version it is possible to
set an interpreter. set an interpreter.
@@ -517,6 +519,10 @@ set an interpreter.
Both setting the directory and setting a project is working. Both setting the directory and setting a project is working.
Examples: "/usr/bin/python3.9", "venv", "../venv", "../venv/bin/python" Examples: "/usr/bin/python3.9", "venv", "../venv", "../venv/bin/python"
The buffer-local variable `b:jedi_environment_path` can be used to override the
global variable `g:jedi#environment_path`.
Default: "auto" Default: "auto"
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

View File

@@ -218,6 +218,8 @@ _current_project_cache = None, None
def get_project(): def get_project():
vim_environment_path = vim_eval("b:jedi_environment_path")
if vim_environment_path in ("", None):
vim_environment_path = vim_eval("g:jedi#environment_path") vim_environment_path = vim_eval("g:jedi#environment_path")
vim_project_path = vim_eval("g:jedi#project_path") vim_project_path = vim_eval("g:jedi#project_path")
vim_added_sys_path = vim_eval("g:jedi#added_sys_path") vim_added_sys_path = vim_eval("g:jedi#added_sys_path")