diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index b7a088c1..46269c35 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -17,33 +17,7 @@ return { desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)", dependencies = { - - -- fancy UI for the debugger - { - "rcarriga/nvim-dap-ui", - dependencies = { "nvim-neotest/nvim-nio" }, - -- stylua: ignore - keys = { - { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, - { "de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, - }, - opts = {}, - config = function(_, opts) - local dap = require("dap") - local dapui = require("dapui") - dapui.setup(opts) - dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open({}) - end - dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close({}) - end - dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close({}) - end - end, - }, - + "rcarriga/nvim-dap-ui", -- virtual text for the debugger { "theHamsta/nvim-dap-virtual-text", @@ -74,10 +48,12 @@ return { }, config = function() - local Config = require("lazyvim.config") + -- trigger loading mason-nvim-dap + require("mason-nvim-dap") + vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) - for name, sign in pairs(Config.icons.dap) do + for name, sign in pairs(LazyVim.config.icons.dap) do sign = type(sign) == "table" and sign or { sign } vim.fn.sign_define( "Dap" .. name, @@ -94,6 +70,32 @@ return { end, }, + -- fancy UI for the debugger + { + "rcarriga/nvim-dap-ui", + dependencies = { "nvim-neotest/nvim-nio" }, + -- stylua: ignore + keys = { + { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, + { "de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, + }, + opts = {}, + config = function(_, opts) + local dap = require("dap") + local dapui = require("dapui") + dapui.setup(opts) + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open({}) + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close({}) + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close({}) + end + end, + }, + -- mason.nvim integration { "jay-babu/mason-nvim-dap.nvim", diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index 0cb3a840..3b66b583 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -30,12 +30,6 @@ return { { "mfussenegger/nvim-dap", optional = true, - dependencies = { - "williamboman/mason.nvim", - opts = { ensure_installed = { - "php-debug-adapter", - } }, - }, opts = function() local dap = require("dap") local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()