From 1258338e628eff482b873cdb243ef7fb77702836 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Sun, 24 Jul 2022 23:14:40 +0200 Subject: fix wrong configuration for dap --- lua/alpha/dap.lua | 158 +++++++++++++++++++++++++++--------------------------- 1 file changed, 79 insertions(+), 79 deletions(-) (limited to 'lua') diff --git a/lua/alpha/dap.lua b/lua/alpha/dap.lua index 397fa99..8145f4b 100644 --- a/lua/alpha/dap.lua +++ b/lua/alpha/dap.lua @@ -3,27 +3,26 @@ local dap, dapui, dap_go = require("dap"), require("dapui"), require("dap-go") require("nvim-dap-virtual-text").setup() dapui.setup({ - icons = { expanded = "▾", collapsed = "▸" }, - layouts = { - { - elements = { - "scopes", - "breakpoints", - "stacks", - "watches", - }, - size = 80, - position = "left", - }, - { - elements = { - "repl", - -- 'console', - }, - size = 5, - position = "bottom", - }, - }, + icons = { expanded = "▾", collapsed = "▸" }, + layouts = { + { + elements = { + "scopes", + "breakpoints", + "stacks", + "watches", + }, size = 80, + position = "left", + }, + { + elements = { + "repl", + -- 'console', + }, + size = 5, + position = "bottom", + }, + }, }) dap_go.setup() @@ -31,31 +30,31 @@ dap_go.setup() vim.fn.sign_define("DapBreakpoint", { text = "ß", texthl = "", linehl = "", numhl = "" }) dap.adapters.php = { - type = "executable", - command = "node", - args = { "php-debug-adapter" }, + type = "executable", + command = "node", + args = { "php-debug-adapter" }, } dap.configurations.php = { - { - type = "php", - request = "launch", - name = "Listen for Xdebug", - port = 9003, - pathMappings = function() - local sail = vim.call("composer#query", "require-dev.laravel/sail") - if sail == "" then - return { ["/app"] = vim.fn.getcwd() } - end - return { ["/var/www/html"] = vim.fn.getcwd() } - end, - }, + { + type = "php", + request = "launch", + name = "Listen for Xdebug", + port = 9003, + pathMappings = function() + local sail = vim.call("composer#query", "require-dev.laravel/sail") + if sail == "" then + return { ["/app"] = vim.fn.getcwd() } + end + return { ["/var/www/html"] = vim.fn.getcwd() } + end, + }, } -- Events Listeners -dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open({}) -end +-- dap.listeners.after.event_initialized["dapui_config"] = function() +-- dapui.open({}) +-- end local hydra = require("hydra") local hint = [[ @@ -63,48 +62,49 @@ local hint = [[ _d_: Start/Continue _j_: StepOver _k_: StepOut _l_: StepInto ^ _bp_: Toogle Breakpoint _cb_: Conditional Breakpoint ^ _c_: Run To Cursor _tt_: Go Debug Test - _sp_: Stop Debbuging + _s_: Start _x_: Stop Debbuging ^^ __ ]] hydra({ - name = "dap", - hint = hint, - mode = "n", - config = { - color = "amaranth", - invoke_on_body = true, - hint = { - border = "rounded", - position = "bottom", - }, - }, - body = "d", - heads = { - { "d", dap.continue }, - { "bp", dap.toggle_breakpoint }, - { "l", dap.step_into }, - { "j", dap.step_over }, - { "k", dap.step_out }, - { "c", dap.run_to_cursor }, - { "tt", dap_go.debug_test }, - { - "cb", - function() - vim.ui.input({ prompt = "Condition: " }, function(condition) - dap.toggle_breakpoint(condition) - end) - end, - }, + name = "dap", + hint = hint, + mode = "n", + config = { + color = "blue", + invoke_on_body = true, + hint = { + border = "rounded", + position = "bottom", + }, + }, + body = "d", + heads = { + { "d", dap.continue }, + { "s", dapui.open }, + { "bp", dap.toggle_breakpoint }, + { "l", dap.step_into }, + { "j", dap.step_over }, + { "k", dap.step_out }, + { "c", dap.run_to_cursor }, + { "tt", dap_go.debug_test }, + { + "cb", + function() + vim.ui.input({ prompt = "Condition: " }, function(condition) + dap.toggle_breakpoint(condition) + end) + end, + }, - { - "sp", - function() - dap.terminate() - dapui.close({}) - dap.clear_breakpoints() - end, - }, + { + "x", + function() + dap.terminate() + dapui.close({}) + dap.clear_breakpoints() + end, + }, - { "", nil, { exit = true } }, - }, + { "", nil, { exit = true } }, + }, }) -- cgit v1.2.3