aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/dap.lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-07-24 23:14:40 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-07-24 23:14:40 +0200
commit1258338e628eff482b873cdb243ef7fb77702836 (patch)
treefb3b14d611ce34ed4292ad6e771e477d6d90bea6 /lua/alpha/dap.lua
parent17961dbdcc4b3621678e41a7a0675d0c9701e89d (diff)
downloadnvim-conf-1258338e628eff482b873cdb243ef7fb77702836.tar.gz
nvim-conf-1258338e628eff482b873cdb243ef7fb77702836.zip
fix wrong configuration for dap
Diffstat (limited to 'lua/alpha/dap.lua')
-rw-r--r--lua/alpha/dap.lua158
1 files changed, 79 insertions, 79 deletions
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
^^ _<Esc>_
]]
hydra({
- name = "dap",
- hint = hint,
- mode = "n",
- config = {
- color = "amaranth",
- invoke_on_body = true,
- hint = {
- border = "rounded",
- position = "bottom",
- },
- },
- body = "<leader>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 = "<leader>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,
+ },
- { "<Esc>", nil, { exit = true } },
- },
+ { "<Esc>", nil, { exit = true } },
+ },
})