Updated config

This commit is contained in:
2025-07-31 20:01:39 +02:00
parent a37eb05681
commit 6019e3c79f
4 changed files with 77 additions and 28 deletions

23
lua/taken/utils/lsp.lua Normal file
View File

@@ -0,0 +1,23 @@
local M = {}
local util = require("lspconfig.util")
local path = util.path
M.get_python_path = function(workspace)
-- Use activated virtualenv.
if vim.env.VIRTUAL_ENV then
return path.join(vim.env.VIRTUAL_ENV, "bin", "python")
end
-- Find and use virtualenv in workspace directory.
for _, pattern in ipairs({ "*", ".*" }) do
local match = vim.fn.glob(path.join(workspace, pattern, "pyvenv.cfg"))
if match ~= "" then
return path.join(path.dirname(match), "bin", "python")
end
end
return nil
end
return M