From 745201acb30977e19b1c3dd4c7a0b2832f80b9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Mu=C3=B1oz=20Paredes?= Date: Tue, 30 Apr 2024 00:24:44 +0200 Subject: [PATCH] Add python-dap --- lua/custom/plugins/venv-selector.lua | 1 + lua/kickstart/plugins/debug.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lua/custom/plugins/venv-selector.lua b/lua/custom/plugins/venv-selector.lua index ade00fb0..1f954805 100644 --- a/lua/custom/plugins/venv-selector.lua +++ b/lua/custom/plugins/venv-selector.lua @@ -2,6 +2,7 @@ return { 'linux-cultist/venv-selector.nvim', dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim', 'mfussenegger/nvim-dap-python' }, opts = { + dap_enabled = true, -- makes the debugger work with venv -- Your options go here -- name = "venv", -- auto_refresh = false diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7be4abdb..7a803a9a 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -23,6 +23,7 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', + 'mfussenegger/nvim-dap-python' }, config = function() local dap = require 'dap' @@ -42,6 +43,7 @@ return { ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want 'delve', + 'debugpy' }, } @@ -83,8 +85,10 @@ return { dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close + local debugpyPythonPath = require("mason-registry").get_package("debugpy"):get_install_path() .. "/venv/bin/python3" -- Install golang specific config require('dap-go').setup() + require("dap-python").setup(debugpyPythonPath, {}) end, }