Files
absolute-vim/lua/absolute/utils/detect-python-env.lua
David Ibia fa59b7988c feat(dap.lua): add virtual text setup for better debugging experience
feat(dap.lua): add support for process.env.PORT environment variable to be able to run app on a configurable port
feat(lsp-config.lua): add support for detecting python environment using DPE module
feat(lualine.lua): add support for noice statusline component
feat(mason.lua): update installed language servers list
feat(noice.lua): add configuration for noice plugin
feat(none-ls.lua): remove black and mypy formatters from null-ls setup

fix(nvim-cmp.lua): change completeopt value to "menu,menuone,preview,noinsert" and add autocomplete trigger event on text change
feat(nvim-cmp.lua): add border and winhighlight settings for documentation window to improve visual appearance
feat(nvim-cmp.lua): add 'nvim_lsp_signature_help' as a source for autocompletion
refactor(colorscheme.lua): refactor SetupWindowPreferences function to dynamically set blend values for highlight groups
feat(init.lua): add setting for 'completeopt' to "menuone"
feat(plugins/noice.lua): add configuration for 'noice.nvim' plugin with dependencies and event trigger
feat(plugins/nvim-treesitter.lua): update configuration to run TSUpdate command silently

feat(utils): add Lua utility functions to detect and manage Lua versions and paths
feat(utils): add Python utility functions to check and resolve Python environments
style(theme): update current theme to 'catppuccin' in Lua script
2024-09-19 14:35:11 +01:00

34 lines
795 B
Lua

function CheckPoetryVirtualEnv()
local poetry = vim.fn.system("poetry env info -p 2>/dev/null")
if poetry == "" then
return nil
end
return poetry
end
function ResolvePythonEnvironment()
-- Get system global python env
local python = vim.fn.system("which python3")
-- Check of virtual environments exists
local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or CheckPoetryVirtualEnv()
if virtual == nil then
-- Check if poetry environment exists
return {
"--python-executable", python
}
end
return {
"--python-executable", virtual .. "/bin/python"
}
end
M = {}
M.ResolvePythonEnvironment = ResolvePythonEnvironment
M.CheckPoetryVirtualEnv = CheckPoetryVirtualEnv
return M