mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 03:04:30 +08:00
Merge pull request #1059 from jamescherti/buffer_jedi_environment_path
The buffer-local variable `b:jedi_environment_path`
This commit is contained in:
@@ -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"
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -218,6 +218,12 @@ _current_project_cache = None, None
|
|||||||
|
|
||||||
|
|
||||||
def get_project():
|
def get_project():
|
||||||
|
try:
|
||||||
|
vim_environment_path = vim_eval("b:jedi_environment_path")
|
||||||
|
except VimError:
|
||||||
|
vim_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")
|
||||||
|
|||||||
Reference in New Issue
Block a user