mirror of
https://github.com/SoPat712/dotfiles.git
synced 2025-08-21 18:38:46 -04:00
python venv
This commit is contained in:
@@ -99,8 +99,27 @@ return {
|
|||||||
lspconfig.lua_ls.setup({
|
lspconfig.lua_ls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
local function get_python_path(workspace)
|
||||||
|
-- Use a pattern to find the venv path in the workspace directory
|
||||||
|
local venv_path = lspconfig.util.path.join(workspace, "venv", "bin", "python")
|
||||||
|
return venv_path
|
||||||
|
end
|
||||||
lspconfig.pyright.setup({
|
lspconfig.pyright.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
before_init = function(_, config)
|
||||||
|
config.settings = {
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
autoSearchPaths = true,
|
||||||
|
useLibraryCodeForTypes = true,
|
||||||
|
},
|
||||||
|
pythonPath = get_python_path(config.root_dir),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
-- Optional: additional setup such as key mappings, etc.
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
lspconfig.rust_analyzer.setup({
|
lspconfig.rust_analyzer.setup({
|
||||||
-- Server-specific settings. See `:help lspconfig-setup`
|
-- Server-specific settings. See `:help lspconfig-setup`
|
||||||
|
Reference in New Issue
Block a user