nvim-dap: impl adapters and configurations

This commit is contained in:
Ching Pei Yang 2026-06-13 00:07:24 +02:00
commit 45f463574e
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -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;