@@ -7,16 +7,32 @@ return {
77 -- Key maps
88 -- See :help dap.txt, :help dap-mapping and :help dap-api.
99 -- debug toogle (breakpoint)
10- vim .keymap .set (" n" , ' <Leader>dt' , dap .toggle_breakpoint , {})
10+ vim .keymap .set (" n" , " <Leader>dt" , dap .toggle_breakpoint , {})
1111 -- debug continue: Launching debug sessions and resuming execution via
12- vim .keymap .set (" n" , ' <Leader>dc' , dap .continue , {})
12+ vim .keymap .set (" n" , " <Leader>dc" , dap .continue , {})
1313 -- debug step (over): Stepping through code over the line
14- vim .keymap .set (" n" , ' <Leader>ds' , dap .step_over , {})
15- -- debug (step) into: Stepping through code into the function
16- vim .keymap .set (" n" , ' <Leader>di' , dap .step_into , {})
14+ vim .keymap .set (" n" , " <Leader>ds" , dap .step_over , {})
15+ -- debug (step) into: Stepping through code into the function
16+ vim .keymap .set (" n" , " <Leader>di" , dap .step_into , {})
1717 -- debug repl: Inspecting the state via the built-in REPL
18- vim .keymap .set (" n" , ' <Leader>dr' , dap .repl .open , {})
19- end
18+ vim .keymap .set (" n" , " <Leader>dr" , dap .repl .open , {})
19+ end ,
20+ },
21+ {
22+ " mfussenegger/nvim-dap-python" ,
23+ ft = " python" ,
24+ dependecies = {
25+ " mfussenegger/nvim-dap" ,
26+ " rcarriga/nvim-dap-ui" ,
27+ },
28+ config = function (_ , opts )
29+ --[[ local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
30+ require("dap-python").setup(path) ]]
31+ local dap = require (" dap-python" )
32+
33+ -- calls dap python run file
34+ vim .keymap .set (" n" , " <leader>dpr" , dap .test_method , {})
35+ end ,
2036 },
2137 {
2238 " rcarriga/nvim-dap-ui" ,
@@ -40,36 +56,60 @@ return {
4056 dap .listeners .before .event_exited .dapui_config = function ()
4157 dapui .close ()
4258 end
43- end
59+ end ,
4460 },
4561 {
4662 " theHamsta/nvim-dap-virtual-text" ,
47- config = function ()
63+ config = function ()
4864 local dap_virtual_text = require (" nvim-dap-virtual-text" )
4965
5066 dap_virtual_text .setup ({
51- enabled = true , -- enable this plugin (the default)
52- enabled_commands = true , -- create commands
53- -- * DapVirtualTextEnable
54- -- * DapVirtualTextDisable
55- -- * DapVirtualTextToggle
56- highlight_changed_variables = true , -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
57- highlight_new_as_changed = false , -- highlight new variables in the same way as changed variables
58- show_stop_reason = true , -- show stop reason when stopped for exceptions
59- commented = false , -- prefix virtual text with comment string
60- only_first_definition = true , -- only show virtual text at first definition (if there are multiple)
61- all_references = false , -- show virtual text on all all references of the variable (not only definitions)
62- clear_on_continue = false , -- clear virtual text on "continue" (might cause flickering when stepping)
63- virt_text_pos = vim .fn .has ' nvim-0.10' == 1 and ' inline' or ' eol' , -- position of virtual text, see `:h nvim_buf_set_extmark()`
67+ enabled = true , -- enable this plugin (the default)
68+ enabled_commands = true , -- create commands
69+ -- * DapVirtualTextEnable
70+ -- * DapVirtualTextDisable
71+ -- * DapVirtualTextToggle
72+ highlight_changed_variables = true , -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
73+ highlight_new_as_changed = false , -- highlight new variables in the same way as changed variables
74+ show_stop_reason = true , -- show stop reason when stopped for exceptions
75+ commented = false , -- prefix virtual text with comment string
76+ only_first_definition = true , -- only show virtual text at first definition (if there are multiple)
77+ all_references = false , -- show virtual text on all all references of the variable (not only definitions)
78+ clear_on_continue = false , -- clear virtual text on "continue" (might cause flickering when stepping)
79+ virt_text_pos = vim .fn .has ( " nvim-0.10" ) == 1 and " inline" or " eol" , -- position of virtual text, see `:h nvim_buf_set_extmark()`
6480 })
65- end
81+ end ,
6682 },
6783 {
6884 " jay-babu/mason-nvim-dap.nvim" ,
69- config = function ()
85+ opts = {
86+ -- This line is essential to making automatic installation work
87+ -- :exploding-brain
88+ -- https://www.johntobin.ie/blog/debugging_in_neovim_with_nvim-dap/
89+ handlers = {},
90+ automatic_installation = {
91+ exclude = {
92+ " python" ,
93+ },
94+ ensure_installed = {
95+ " python" ,
96+ " debugpy" ,
97+ },
98+ },
99+ },
100+ dependencies = {
101+ " mfussenegger/nvim-dap" ,
102+ " williamboman/mason.nvim" ,
103+ },
104+ config = function ()
70105 require (" mason-nvim-dap" ).setup ({
71106 automatic_installation = true ,
107+ ensure_installed = {
108+ " python" ,
109+ " debugpy" ,
110+ },
72111 })
73- end
112+ end ,
74113 },
75114}
115+
0 commit comments