format with stylua

This commit is contained in:
2024-06-06 23:56:11 +02:00
parent d57eca961d
commit ae5b5fd06b
57 changed files with 994 additions and 989 deletions

View File

@ -62,14 +62,14 @@ function M.getPythonEnvs()
if venv ~= nil then
table.insert(venvs, {
name = 'VIRTUAL_ENV',
path = string.format('%s/%s', venv, M.getVenvSuffix())
path = string.format('%s/%s', venv, M.getVenvSuffix()),
})
end
local conda = os.getenv('CONDA_PREFIX')
if conda ~= nil then
table.insert(venvs, {
name = 'CONDA_PREFIX',
path = string.format('%s/%s', conda, 'python.exe')
path = string.format('%s/%s', conda, 'python.exe'),
})
end
@ -79,7 +79,7 @@ function M.getPythonEnvs()
if jsonVenv ~= nil then
table.insert(venvs, {
name = 'pyrightconfig.json',
path = jsonVenv .. '/' .. M.getVenvSuffix()
path = jsonVenv .. '/' .. M.getVenvSuffix(),
})
end
@ -88,20 +88,20 @@ function M.getPythonEnvs()
if vim.fn.executable(cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix()) == 1 then
table.insert(venvs, {
name = envDir,
path = cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix()
path = cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix(),
})
end
end
if vim.loop.os_uname().sysname == 'Linux' then
table.insert(venvs, {
name = 'system',
path = '/usr/bin/python'
path = '/usr/bin/python',
})
end
if vim.loop.os_uname().sysname == 'Windows_NT' then
table.insert(venvs, {
name = 'system',
path = os.getenv('SCOOP') .. '/apps/python/current/python.exe'
path = os.getenv('SCOOP') .. '/apps/python/current/python.exe',
})
end
return venvs
@ -110,7 +110,9 @@ end
M.pick_venv = function()
vim.ui.select(M.getPythonEnvs(), {
prompt = 'Select python venv',
format_item = function(item) return string.format('%s (%s)', item.name, item.path) end,
format_item = function(item)
return string.format('%s (%s)', item.name, item.path)
end,
}, function(choice)
if not choice then
return