nvim: Refactor automatic py venv call
This commit is contained in:
parent
1c8c5ca6d9
commit
1665dd6cf6
3 changed files with 9 additions and 5 deletions
|
|
@ -126,9 +126,10 @@ local lspconfig = require("lspconfig")
|
|||
|
||||
-- ensure python virtualenv is determined automatically on lsp start
|
||||
lspconfig.pyright.setup({
|
||||
on_attach = function(client, _)
|
||||
local python_path, msg = require("util.pyenv").get_path(client.config.root_dir)
|
||||
vim.notify(string.format("%s\n%s", msg, python_path))
|
||||
on_attach = function(client, bufnr)
|
||||
on_attach(client, bufnr)
|
||||
local python_path, msg = require("util").get_python_venv(client.config.root_dir)
|
||||
vim.notify_once(string.format("[PYTHON VENV]\n%s", python_path))
|
||||
client.config.settings.python.pythonPath = python_path
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue