Setups python debugger

This commit is contained in:
Thomas Lazarus 2025-11-06 22:22:45 -06:00
parent 2e03cfad57
commit ebd12e7ab1
No known key found for this signature in database
1 changed files with 4 additions and 23 deletions

View File

@ -12,7 +12,6 @@ return {
'jay-babu/mason-nvim-dap.nvim', 'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here -- Add your own debuggers here
'leoluz/nvim-dap-go',
'mfussenegger/nvim-dap-python', 'mfussenegger/nvim-dap-python',
}, },
keys = { keys = {
@ -72,26 +71,17 @@ return {
local dap = require 'dap' local dap = require 'dap'
local dapui = require 'dapui' local dapui = require 'dapui'
require('dap-python').setup { 'uv' }
require('dap-python').test_runner = 'pytest'
require('mason-nvim-dap').setup { require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true, automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {}, handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = { ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want 'python',
'delve',
}, },
} }
require('dap-python').setup 'uv'
require('dap-python').test_runner = 'pytest'
-- Dap UI setup -- Dap UI setup
-- For more information, see |:help nvim-dap-ui| -- For more information, see |:help nvim-dap-ui|
dapui.setup { dapui.setup {
@ -129,14 +119,5 @@ return {
dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
require('dap-go').setup {
delve = {
-- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
detached = vim.fn.has 'win32' == 0,
},
}
end, end,
} }