From 940d7df59aac01f6cc587f035d9b4913139fae60 Mon Sep 17 00:00:00 2001 From: moetayuko Date: Wed, 24 Jul 2024 03:27:29 +0800 Subject: [PATCH] fix(dap): don't mess up DAP adapters provided by nvim-dap-python (#4141) ## Description * mason-nvim-dap.nvim ships a `Python: Launch file` adapter which does the same thing as `Launch file` of nvim-dap-python, providing both doesn't make sense and confuses the users. * mason-nvim-dap.nvim unexpectedly overrides nvim-dap-python's adapters and breaks its venv detection. As a result, user programs are always executed in mason debugpy venv rather than the activated one. ## Related Issue(s) Fixes #3064 ## Screenshots ## Checklist - [X] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index a06b63d7..f85b23be 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -138,4 +138,15 @@ return { table.insert(opts.auto_brackets, "python") end, }, + + -- Don't mess up DAP adapters provided by nvim-dap-python + { + "jay-babu/mason-nvim-dap.nvim", + optional = true, + opts = { + handlers = { + python = function() end, + }, + }, + }, }