nvim dap python with additional configuration
This commit is contained in:
parent
5b7bdcc5fb
commit
12a60bb991
|
@ -1,24 +1,22 @@
|
||||||
local dap = require('dap')
|
|
||||||
return function()
|
return function()
|
||||||
local python_install_path = vim.fn.exepath('python')
|
--local python_install_path = vim.fn.exepath('python')
|
||||||
dap.adapters.python = {
|
require('dap-python').setup() -- Debug with default settings.
|
||||||
type = "executable",
|
|
||||||
command = python_install_path, -- use "which python" command will give you python installed path
|
-- We can set additional custom config by below mechanism as well
|
||||||
args = {
|
--[[
|
||||||
"-m",
|
table.insert(require('dap').configurations.python,
|
||||||
"debugpy.adapter",
|
{
|
||||||
},
|
type = 'python',
|
||||||
}
|
request = 'launch',
|
||||||
|
name = 'My custom launch configuration',
|
||||||
dap.configurations.python = {
|
program = '${file}',
|
||||||
{
|
cwd = vim.fn.getcwd(),
|
||||||
type = "python",
|
console= "integratedTerminal",
|
||||||
request = "launch",
|
})
|
||||||
name = "Launch file",
|
--]]
|
||||||
program = "${file}", -- This configuration will launch the current file if used.
|
|
||||||
console= "integratedTerminal",
|
table.insert(require('dap').configurations.python,
|
||||||
},
|
{
|
||||||
{
|
|
||||||
name= "Pytest: Current File",
|
name= "Pytest: Current File",
|
||||||
type= "python",
|
type= "python",
|
||||||
request= "launch",
|
request= "launch",
|
||||||
|
@ -30,7 +28,8 @@ return function()
|
||||||
"--log-file=test_out.log"
|
"--log-file=test_out.log"
|
||||||
},
|
},
|
||||||
console= "integratedTerminal",
|
console= "integratedTerminal",
|
||||||
},
|
})
|
||||||
|
table.insert(require('dap').configurations.python,
|
||||||
{
|
{
|
||||||
name= "Profile python: Current File",
|
name= "Profile python: Current File",
|
||||||
type= "python",
|
type= "python",
|
||||||
|
@ -42,6 +41,5 @@ return function()
|
||||||
"${file}"
|
"${file}"
|
||||||
},
|
},
|
||||||
console= "integratedTerminal",
|
console= "integratedTerminal",
|
||||||
},
|
})
|
||||||
}
|
end
|
||||||
end
|
|
||||||
|
|
Loading…
Reference in New Issue