Skip to content

Commit b3926ac

Browse files
committed
refactor(nvim): remove dap
1 parent bcfdb30 commit b3926ac

File tree

2 files changed

+8
-223
lines changed

2 files changed

+8
-223
lines changed

nvim/lazy-lock.json

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
{
22
"blink.cmp": { "branch": "main", "commit": "dcda20d3aa345025699a920c45b0a0603551f41d" },
3-
"conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" },
3+
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
44
"edgy.nvim": { "branch": "main", "commit": "7e8dedc39abebe40c289b8012cc89b11c69aa7a0" },
55
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
66
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
7-
"gitsigns.nvim": { "branch": "main", "commit": "ee7e50dfbdf49e3acfa416fd3ad3abbdb658582c" },
7+
"gitsigns.nvim": { "branch": "main", "commit": "0cb5a7753d3c4b8e9cfdc9d88d9110cb8d4b1544" },
88
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
99
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
1010
"lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" },
1111
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
12-
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
1312
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
14-
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
15-
"mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
16-
"mini.surround": { "branch": "main", "commit": "f4307f935ad87cfe3e570dbaae485b35cce4e5ec" },
17-
"neo-tree.nvim": { "branch": "main", "commit": "e01ca7de8e6dbc6118bcb12c4cbe1f88162a337f" },
13+
"mini.icons": { "branch": "main", "commit": "94848dad1589a199f876539bd79befb0c5e3abf0" },
14+
"mini.pairs": { "branch": "main", "commit": "42407ccb80ec59c84e7c91d815f42ed90a8cc093" },
15+
"mini.surround": { "branch": "main", "commit": "f59022c2c66c1cffd3cd755b105faa468b25a4e0" },
16+
"neo-tree.nvim": { "branch": "main", "commit": "b85cc7611ff8fb443b0a1591c53669ead195a826" },
1817
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
1918
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
20-
"nvim-dap": { "branch": "master", "commit": "40a8189b8a57664a1850b0823fdcb3ac95b9f635" },
21-
"nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" },
22-
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
2319
"nvim-lspconfig": { "branch": "master", "commit": "8a1529e46eef5efc86c34c8d9bdd313abc2ecba0" },
24-
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
25-
"nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },
26-
"nvim-treesitter-context": { "branch": "master", "commit": "5c48b8ba1b0b7b25feb6e34e7eb293ea893aedc4" },
20+
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
21+
"nvim-treesitter-context": { "branch": "master", "commit": "59f318a65d42a5c4037796886a8874fd57f774fc" },
2722
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
2823
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
2924
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },

nvim/lua/plugins.lua

Lines changed: 0 additions & 210 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,6 @@ return {
468468
color = "MsgArea",
469469
},
470470
-- stylua: ignore
471-
{
472-
function() return "" .. require("dap").status() end,
473-
cond = function() return require("dap").status() ~= "" end,
474-
color = "MsgArea",
475-
},
476-
-- stylua: ignore
477471
{ require("lazy.status").updates, cond = require("lazy.status").has_updates, color = "MsgArea" },
478472
{ "progress", color = "MsgArea" },
479473
{ "location", color = "MsgArea" },
@@ -508,7 +502,6 @@ return {
508502
opts = {
509503
ensure_installed = {
510504
"biome",
511-
"js-debug-adapter",
512505
"shfmt",
513506
"stylua",
514507
"svelte-language-server",
@@ -541,30 +534,6 @@ return {
541534
end,
542535
},
543536

544-
-- mason-nvim-dap.nvim (https://github.com/jay-babu/mason-nvim-dap.nvim)
545-
{
546-
"jay-babu/mason-nvim-dap.nvim",
547-
dependencies = "mason.nvim",
548-
cmd = { "DapInstall", "DapUninstall" },
549-
opts = {
550-
-- Makes a best effort to setup the various debuggers with
551-
-- reasonable debug configurations
552-
automatic_installation = true,
553-
554-
-- You can provide additional configuration to the handlers,
555-
-- see mason-nvim-dap README for more information
556-
handlers = {},
557-
558-
-- You'll need to check that you have the required things installed
559-
-- online, please don't ask me how to install them :)
560-
ensure_installed = {
561-
-- Update this to ensure that you have the debuggers for the langs you want
562-
},
563-
},
564-
-- mason-nvim-dap is loaded when nvim-dap loads
565-
config = function() end,
566-
},
567-
568537
-- mini.nvim (https://github.com/echasnovski/mini.nvim)
569538
{
570539
"echasnovski/mini.icons",
@@ -819,185 +788,6 @@ return {
819788
end,
820789
},
821790

822-
-- nvim-dap (https://github.com/mfussenegger/nvim-dap)
823-
{
824-
"mfussenegger/nvim-dap",
825-
event = "VeryLazy",
826-
dependencies = {
827-
-- https://github.com/rcarriga/nvim-dap-ui
828-
{
829-
"rcarriga/nvim-dap-ui",
830-
dependencies = { "nvim-neotest/nvim-nio" },
831-
-- stylua: ignore
832-
keys = {
833-
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
834-
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
835-
},
836-
opts = {
837-
controls = { enabled = false },
838-
icons = {
839-
collapsed = icons.tree.Closed,
840-
current_frame = icons.tree.Closed,
841-
expanded = icons.tree.Open,
842-
},
843-
},
844-
config = function(_, opts)
845-
local dap = require("dap")
846-
local dapui = require("dapui")
847-
dapui.setup(opts)
848-
dap.listeners.after.event_initialized["dapui_config"] = function()
849-
-- dapui.open({})
850-
end
851-
dap.listeners.before.event_terminated["dapui_config"] = function()
852-
dapui.close({})
853-
end
854-
dap.listeners.before.event_exited["dapui_config"] = function()
855-
dapui.close({})
856-
end
857-
end,
858-
},
859-
-- https://github.com/theHamsta/nvim-dap-virtual-text
860-
{
861-
"theHamsta/nvim-dap-virtual-text",
862-
opts = {},
863-
},
864-
},
865-
-- stylua: ignore
866-
keys = {
867-
{ "<leader>d", "", desc = "+debug", mode = {"n", "v"} },
868-
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
869-
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
870-
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
871-
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
872-
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" },
873-
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
874-
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
875-
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
876-
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
877-
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
878-
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
879-
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
880-
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
881-
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
882-
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
883-
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
884-
{
885-
"<leader>da",
886-
function()
887-
---@param config {args?:string[]|fun():string[]?}
888-
local function get_args(config)
889-
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {}
890-
local args_str = type(args) == "table" and table.concat(args, " ") or args --[[@as string]]
891-
config = vim.deepcopy(config)
892-
---@cast args string[]
893-
config.args = function()
894-
local new_args = vim.fn.expand(vim.fn.input("Run with args: ", args_str)) --[[@as string]]
895-
return require("dap.utils").splitstr(new_args)
896-
end
897-
return config
898-
end
899-
require("dap").continue({ before = get_args })
900-
end,
901-
desc = "Run with Args",
902-
},
903-
},
904-
opts = function()
905-
local dap = require("dap")
906-
require("dap").adapters["pwa-node"] = {
907-
type = "server",
908-
host = "localhost",
909-
port = "${port}",
910-
executable = {
911-
command = "node",
912-
-- TODO: Make sure to update this path to point to your installation
913-
args = {
914-
require("util.init").get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js"),
915-
"${port}",
916-
},
917-
},
918-
}
919-
dap.adapters["node"] = function(cb, config)
920-
if config.type == "node" then
921-
config.type = "pwa-node"
922-
end
923-
local nativeAdapter = dap.adapters["pwa-node"]
924-
if type(nativeAdapter) == "function" then
925-
nativeAdapter(cb, config)
926-
else
927-
cb(nativeAdapter)
928-
end
929-
end
930-
931-
local js_filetypes = { "typescript", "javascript", "typescriptreact", "javascriptreact" }
932-
933-
local vscode = require("dap.ext.vscode")
934-
vscode.type_to_filetypes["node"] = js_filetypes
935-
vscode.type_to_filetypes["pwa-node"] = js_filetypes
936-
937-
for _, language in ipairs(js_filetypes) do
938-
if not dap.configurations[language] then
939-
dap.configurations[language] = {
940-
{
941-
name = "Launch file (TypeScript)",
942-
request = "launch",
943-
type = "pwa-node",
944-
console = "integratedTerminal",
945-
cwd = "${workspaceFolder}",
946-
program = "${file}",
947-
runtimeExecutable = "${workspaceFolder}/node_modules/.bin/tsx",
948-
skipFiles = { "<node_internals>/**" },
949-
},
950-
{
951-
name = "Launch file (JavaScript)",
952-
request = "launch",
953-
type = "pwa-node",
954-
cwd = "${workspaceFolder}",
955-
program = "${file}",
956-
},
957-
{
958-
name = "Attach",
959-
cwd = "${workspaceFolder}",
960-
processId = require("dap.utils").pick_process,
961-
request = "attach",
962-
type = "pwa-node",
963-
},
964-
}
965-
end
966-
end
967-
968-
local elixir_ls_debugger = vim.fn.exepath("elixir-ls-debugger")
969-
if elixir_ls_debugger ~= "" then
970-
dap.adapters["mix_task"] = {
971-
command = elixir_ls_debugger,
972-
type = "executable",
973-
}
974-
end
975-
end,
976-
config = function()
977-
-- load mason-nvim-dap here, after all adapters have been setup
978-
if require("util.init").has("mason-nvim-dap.nvim") then
979-
require("mason-nvim-dap").setup(require("util.init").opts("mason-nvim-dap.nvim"))
980-
end
981-
982-
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
983-
984-
for name, sign in pairs(icons.dap) do
985-
sign = type(sign) == "table" and sign or { sign }
986-
vim.fn.sign_define(
987-
"Dap" .. name,
988-
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
989-
)
990-
end
991-
992-
-- setup dap config by VsCode launch.json file
993-
local vscode = require("dap.ext.vscode")
994-
local json = require("plenary.json")
995-
vscode.json_decode = function(str)
996-
return vim.json.decode(json.json_strip_comments(str))
997-
end
998-
end,
999-
},
1000-
1001791
-- nvim-lspconfig (https://github.com/neovim/nvim-lspconfig)
1002792
{
1003793
"neovim/nvim-lspconfig",

0 commit comments

Comments
 (0)