From 45f463574ee0de0f1f7d88ae3d851fffdf20f284 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 13 Jun 2026 00:07:24 +0200 Subject: [PATCH] nvim-dap: impl adapters and configurations --- modules/plugins/debugger/nvim-dap/config.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/plugins/debugger/nvim-dap/config.nix b/modules/plugins/debugger/nvim-dap/config.nix index 70bd9891..a495bda7 100644 --- a/modules/plugins/debugger/nvim-dap/config.nix +++ b/modules/plugins/debugger/nvim-dap/config.nix @@ -4,11 +4,13 @@ lib, ... }: let + inherit (builtins) concatStringsSep; inherit (lib.strings) optionalString; inherit (lib.modules) mkIf mkMerge; - inherit (lib.attrsets) mapAttrs; + inherit (lib.attrsets) mapAttrs mapAttrsToList; inherit (lib.nvim.binds) mkKeymap; inherit (lib.nvim.dag) entryAnywhere entryAfter; + inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.debugger.nvim-dap; opt = { @@ -28,6 +30,22 @@ in { nvim-dap = entryAnywhere '' local dap = require("dap") vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "ErrorMsg", linehl = "", numhl = "" }) + + ${ + concatStringsSep "\n" + (mapAttrsToList (name: opts: '' + dap.adapters[${toLuaObject name}] = ${toLuaObject opts} + '') + cfg.adapters) + } + + ${ + concatStringsSep "\n" + (mapAttrsToList (ft: opts: '' + dap.configurations[${toLuaObject ft}] = ${toLuaObject opts} + '') + cfg.configurations) + } ''; } // mapAttrs (_: v: (entryAfter ["nvim-dap"] v)) cfg.sources;