Python debugging
This commit is contained in:
@@ -576,7 +576,17 @@ require('lazy').setup({
|
|||||||
},
|
},
|
||||||
-- C# Csharp
|
-- C# Csharp
|
||||||
roslyn = {},
|
roslyn = {},
|
||||||
pylsp = {},
|
pylsp = {
|
||||||
|
settings = {
|
||||||
|
pylsp = {
|
||||||
|
plugins = {
|
||||||
|
pycodestyle = {
|
||||||
|
ignore = { 'E501' }, -- ignore line length, let black formatter manage this, sometimes lines must be long.
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Ensure the servers and tools above are installed
|
-- Ensure the servers and tools above are installed
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" },
|
"nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" },
|
||||||
"nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" },
|
"nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" },
|
"nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" },
|
||||||
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "fdb04e9285edefbe25a02a31a35e8fbb10fe054d" },
|
"nvim-lint": { "branch": "master", "commit": "fdb04e9285edefbe25a02a31a35e8fbb10fe054d" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" },
|
"nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
|
|||||||
@@ -22,8 +22,11 @@ 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',
|
'leoluz/nvim-dap-go', -- came pre-packaged with this
|
||||||
|
-- Python debugging
|
||||||
'mfussenegger/nvim-dap-python',
|
'mfussenegger/nvim-dap-python',
|
||||||
|
-- adds inline variables
|
||||||
|
'theHamsta/nvim-dap-virtual-text',
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
-- Basic debugging keymaps, feel free to change to your liking!
|
-- Basic debugging keymaps, feel free to change to your liking!
|
||||||
@@ -69,6 +72,13 @@ return {
|
|||||||
end,
|
end,
|
||||||
desc = 'Debug: Set Breakpoint',
|
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.
|
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||||
{
|
{
|
||||||
'<F7>',
|
'<F7>',
|
||||||
@@ -77,6 +87,13 @@ return {
|
|||||||
end,
|
end,
|
||||||
desc = 'Debug: See last session result.',
|
desc = 'Debug: See last session result.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'<leader>de',
|
||||||
|
function()
|
||||||
|
require('dapui').eval(vim.fn.expand '<cword>')
|
||||||
|
end,
|
||||||
|
desc = 'Evaluate expression under cursor',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require 'dap'
|
local dap = require 'dap'
|
||||||
@@ -146,6 +163,14 @@ return {
|
|||||||
detached = vim.fn.has 'win32' == 0,
|
detached = vim.fn.has 'win32' == 0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
-- Setup python debugging
|
||||||
require('dap-python').setup 'python'
|
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,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user