Update debug.lua

This commit is contained in:
SamPosh 2023-04-20 14:44:53 +05:30 committed by GitHub
parent 29427dffc1
commit 9f6357ef3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 49 deletions

View File

@ -38,55 +38,11 @@ return {
-- In below way also we can setup debugger for python
-- Need to install pip3 install debugpy. In dockerfile it is already there. If you are using configuation alone
-- without dockerfile then install debugpy or mention the python path where debugpy is installed.
--[[
handlers = {
python = 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=tc_medusa.log"
},
console= "integratedTerminal",
},
{
name= "Profile python: Current File",
type= "python",
request= "launch",
module= "cProfile",
args= {
"-o",
"/tmp/profile.dat",
"${file}"
},
console= "integratedTerminal",
},
}
end,
},
--]]
-- python debug configuration is moved to this file
python = require('kickstart.plugins.dap.handler.python'),
},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
@ -136,7 +92,8 @@ return {
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install python specific config
-- Install python specific config can be done below way as well instead of handler
--[[
require('dap-python').setup() -- Debug with default settings.
-- We can set additional custom config by below mechanism as well
table.insert(require('dap').configurations.python, {
@ -147,6 +104,7 @@ return {
cwd = vim.fn.getcwd(),
console= "integratedTerminal",
})
--]]
end,
}