Update debug.lua

This commit is contained in:
SamPosh 2023-04-10 14:58:59 +05:30 committed by GitHub
parent 81b0345c00
commit 1ed56ecc62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 18 deletions

View File

@ -82,23 +82,6 @@ return {
-- Install golang specific config
require('dap-go').setup()
pythonPath = function()
--The below line will work for virtualenvwrapper, as vim.env.VIRTUAL_ENV points to the active env directory if you use it
--Test the variable by running :lua print(vim.env.VIRTUAL_ENV) and find your path from there if it is defined
if vim.env.VIRTUAL_ENV then return vim.env.VIRTUAL_ENV ..'/bin/python' end
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable (done above).
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/usr/bin/python3'
end
end;
}
}
end,
}