Python debug configuration is added

This commit is contained in:
SamPosh 2023-04-20 14:53:40 +05:30 committed by GitHub
parent 9924f7e0a0
commit 685f99b9e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,46 @@
local dap = require('dap')
return function()
dap.adapters.python = {
type = "executable",
command = "/usr/local/bin/python", -- use "which python" command and provide the python path
args = {
"-m",
"debugpy.adapter",
},
}
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}", -- This configuration will launch the current file if used.
console= "integratedTerminal",
},
{
name= "Pytest: Current File",
type= "python",
request= "launch",
module= "pytest",
args= {
"${file}",
"-sv",
"--log-cli-level=INFO",
"--log-file=test_out.log"
},
console= "integratedTerminal",
},
{
name= "Profile python: Current File",
type= "python",
request= "launch",
module= "cProfile",
args= {
"-o",
"/tmp/profile.dat",
"${file}"
},
console= "integratedTerminal",
},
}
end