Python debugging
This commit is contained in:
@@ -22,8 +22,11 @@ return {
|
||||
'jay-babu/mason-nvim-dap.nvim',
|
||||
|
||||
-- Add your own debuggers here
|
||||
'leoluz/nvim-dap-go',
|
||||
'leoluz/nvim-dap-go', -- came pre-packaged with this
|
||||
-- Python debugging
|
||||
'mfussenegger/nvim-dap-python',
|
||||
-- adds inline variables
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
},
|
||||
keys = {
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
@@ -69,6 +72,13 @@ return {
|
||||
end,
|
||||
desc = 'Debug: Set Breakpoint',
|
||||
},
|
||||
{
|
||||
'<F6>',
|
||||
function()
|
||||
require('dap').disconnect { terminate = true }
|
||||
end,
|
||||
desc = 'Debug: See last session result.',
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
{
|
||||
'<F7>',
|
||||
@@ -77,6 +87,13 @@ return {
|
||||
end,
|
||||
desc = 'Debug: See last session result.',
|
||||
},
|
||||
{
|
||||
'<leader>de',
|
||||
function()
|
||||
require('dapui').eval(vim.fn.expand '<cword>')
|
||||
end,
|
||||
desc = 'Evaluate expression under cursor',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local dap = require 'dap'
|
||||
@@ -146,6 +163,14 @@ return {
|
||||
detached = vim.fn.has 'win32' == 0,
|
||||
},
|
||||
}
|
||||
-- Setup python debugging
|
||||
require('dap-python').setup 'python'
|
||||
-- Setup inline variables
|
||||
require('nvim-dap-virtual-text').setup {
|
||||
virt_text_pos = 'inline',
|
||||
virt_lines = true,
|
||||
highlight_changed_variables = true,
|
||||
all_frames = false,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user