mirror of https://gitlab.com/baco/dotconf.git
feat(LSP): Modify the way a virtual env is located
Changed the hard-coded virtual environment directory name used to look for Python related binaries to whatever directory is defined in the `VIRTUAL_ENV` environment variable. That variable's value is more reliable, even more when Python virtual environments are located in a central location, not near the repository.
This commit is contained in:
parent
8d626d2188
commit
b15b9178c6
|
@ -35,8 +35,8 @@ local pylsp_settings = {
|
|||
},
|
||||
}
|
||||
|
||||
local venv_dir = vim.fn.finddir(".venv/", vim.fn.expand("%:p:h") .. ";")
|
||||
if venv_dir ~= "" then
|
||||
local venv_dir = vim.env.VIRTUAL_ENV
|
||||
if venv_dir ~= nil then
|
||||
local python_exec = vim.fn.findfile("python", venv_dir .. "/bin;")
|
||||
if python_exec ~= "" then
|
||||
pylsp_settings.plugins.jedi = {environment = python_exec}
|
||||
|
|
Loading…
Reference in New Issue