From eff0d7fe2aa0fc27256ba4de54b0ea1b0bc5a36f Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Wed, 5 Jul 2023 14:21:22 -0400 Subject: [PATCH] perf(python): make sure mason-nvim-dap doesn't set up python debuggers (#369) --- lua/astrocommunity/pack/python/init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/astrocommunity/pack/python/init.lua b/lua/astrocommunity/pack/python/init.lua index bf695c757..641daa662 100644 --- a/lua/astrocommunity/pack/python/init.lua +++ b/lua/astrocommunity/pack/python/init.lua @@ -20,7 +20,11 @@ return { }, { "jay-babu/mason-nvim-dap.nvim", - opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "python") end, + opts = function(_, opts) + opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "python") + if not opts.handlers then opts.handlers = {} end + opts.handlers.python = function() end -- make sure python doesn't get set up by mason-nvim-dap, it's being set up by nvim-dap-python + end, }, { "linux-cultist/venv-selector.nvim", @@ -29,10 +33,8 @@ return { }, { "mfussenegger/nvim-dap-python", - dependencies = { "mfussenegger/nvim-dap" }, - -- NOTE: ft: lazy-load on filetype - ft = "python", - event = "User AstroFile", + dependencies = "mfussenegger/nvim-dap", + ft = "python", -- NOTE: ft: lazy-load on filetype config = function(_, opts) local path = require("mason-registry").get_package("debugpy"):get_install_path() .. "/venv/bin/python" require("dap-python").setup(path, opts)