feat: attach to debug py
This commit is contained in:
parent
11aa5558aa
commit
28ebd31fb9
2 changed files with 18 additions and 2 deletions
12
mappings.lua
12
mappings.lua
|
@ -35,7 +35,17 @@ M.dap_python = {
|
|||
n = {
|
||||
["<leader>dpr"] = {
|
||||
function()
|
||||
require('dap-python').test_method()
|
||||
local dap = require('dap')
|
||||
dap.run({
|
||||
type = 'python',
|
||||
request = 'attach',
|
||||
name = 'Debugpy',
|
||||
justMyCode = false,
|
||||
connect = {
|
||||
host = '127.0.0.1',
|
||||
port = 5678,
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,12 @@ local plugins = {
|
|||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
end
|
||||
},
|
||||
{
|
||||
|
@ -34,7 +40,7 @@ local plugins = {
|
|||
config = function(_, opts)
|
||||
local pyenv = os.getenv("VIRTUAL_ENV") or "/usr"
|
||||
local path = pyenv .. "/bin/python3"
|
||||
require("dap-python").setup(path)
|
||||
require("dap-python").setup(path, opts)
|
||||
require("core.utils").load_mappings("dap_python")
|
||||
end,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue