aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/dap
diff options
context:
space:
mode:
Diffstat (limited to 'lua/alpha/dap')
-rw-r--r--lua/alpha/dap/configs/dart.lua2
-rw-r--r--lua/alpha/dap/configs/elixir.lua52
-rw-r--r--lua/alpha/dap/configs/javascript.lua103
-rw-r--r--lua/alpha/dap/init.lua4
4 files changed, 116 insertions, 45 deletions
diff --git a/lua/alpha/dap/configs/dart.lua b/lua/alpha/dap/configs/dart.lua
index cdb7a47..a23c118 100644
--- a/lua/alpha/dap/configs/dart.lua
+++ b/lua/alpha/dap/configs/dart.lua
@@ -27,6 +27,6 @@ dap.configurations.dart = {
-- The nvim-dap plugin populates this variable with the editor's current working directory
cwd = "${workspaceFolder}",
-- This gets forwarded to the Flutter CLI tool, substitute `linux` for whatever device you wish to launch
- toolArgs = {"-d", "192.168.0.15:5555"}
+ toolArgs = {"-d", "192.168.0.33:5555"}
}
}
diff --git a/lua/alpha/dap/configs/elixir.lua b/lua/alpha/dap/configs/elixir.lua
new file mode 100644
index 0000000..bf732ce
--- /dev/null
+++ b/lua/alpha/dap/configs/elixir.lua
@@ -0,0 +1,52 @@
+local dap = require('dap')
+
+dap.adapters.mix_task = {
+ type = 'executable',
+ command = 'elixir-ls-debugger', -- El comando 'elixir-ls' está en $PATH
+ args = {}
+}
+
+dap.configurations.elixir = {
+ {
+ type = "mix_task",
+ name = "mix (Default task)",
+ request = "launch",
+ projectDir = "${workspaceRoot}"
+ },
+ {
+ type = "mix_task",
+ name = "mix test",
+ request = "launch",
+ task = 'test',
+ env = {
+ MIX_ENV = "test",
+ MIX_TARGET = "host",
+ HEX_UNSAFE_HTTPS = 1
+ },
+ taskArgs = {"--trace"},
+ startApps = true, -- for Phoenix projects
+ projectDir = "${workspaceFolder}",
+ requireFiles = {
+ "test/**/test_helper.exs",
+ "test/**/*_test.exs"
+ }
+ },
+ {
+ type = "mix_task",
+ name = "phx server",
+ request = "launch",
+ stackTraceMode = "all",
+ task = 'phx.server',
+ debugAutoInterpretAllModules = true,
+ noDebug = false,
+ exitAfterTaskReturns = false,
+ env = {
+ MIX_ENV = "dev",
+ MIX_TARGET = "host",
+ HEX_UNSAFE_HTTPS = 1
+ },
+ startApps = false, -- for Phoenix projects
+ taskArgs = {"--no-halt", "--open"},
+ projectDir = "${workspaceFolder}",
+ },
+}
diff --git a/lua/alpha/dap/configs/javascript.lua b/lua/alpha/dap/configs/javascript.lua
index b910f30..03173ba 100644
--- a/lua/alpha/dap/configs/javascript.lua
+++ b/lua/alpha/dap/configs/javascript.lua
@@ -1,45 +1,62 @@
-require("dap-vscode-js").setup {
- debugger_cmd = { "js-debug-adapter" },
- adapters = { "pwa-node", "pwa-chrome", "node-terminal" },
+local dap = require('dap')
+dap.adapters.firefox = {
+ type = 'executable',
+ command = 'firefox-debug-adapter',
}
-for _, language in ipairs { "typescript", "javascript" } do
- require("dap").configurations[language] = {
- {
- type = "pwa-node",
- request = "launch",
- name = "Launch file",
- program = "${file}",
- cwd = "${workspaceFolder}",
- },
- {
- type = "pwa-node",
- request = "attach",
- name = "Attach",
- processId = require("dap.utils").pick_process,
- cwd = "${workspaceFolder}",
- },
- }
-end
-
-for _, language in ipairs { "typescriptreact", "javascriptreact" } do
- require("dap").configurations[language] = {
- {
- type = "pwa-chrome",
- name = "Attach - Remote Debugging",
- request = "attach",
- program = "${file}",
- cwd = vim.fn.getcwd(),
- sourceMaps = true,
- protocol = "inspector",
- port = 9222,
- webRoot = "${workspaceFolder}",
- },
- {
- type = "pwa-chrome",
- name = "Launch Chrome",
- request = "launch",
- url = "http://localhost:3000",
- },
- }
-end
+dap.configurations.typescript = {
+ {
+ name = 'Debug with Firefox',
+ type = 'firefox',
+ request = 'launch',
+ reAttach = true,
+ url = 'http://localhost:3010',
+ webRoot = '${workspaceFolder}',
+ firefoxExecutable = '/home/elvis/.local/bin/firefox'
+ },
+}
+-- require("dap-vscode-js").setup {
+-- debugger_cmd = { "js-debug-adapter" },
+-- adapters = { "pwa-node", "pwa-chrome", "node-terminal" },
+-- }
+--
+-- for _, language in ipairs { "typescript", "javascript" } do
+-- require("dap").configurations[language] = {
+-- {
+-- type = "pwa-node",
+-- request = "launch",
+-- name = "Launch file",
+-- program = "${file}",
+-- cwd = "${workspaceFolder}",
+-- },
+-- {
+-- type = "pwa-node",
+-- request = "attach",
+-- name = "Attach",
+-- processId = require("dap.utils").pick_process,
+-- cwd = "${workspaceFolder}",
+-- },
+-- }
+-- end
+--
+-- for _, language in ipairs { "typescriptreact", "javascriptreact" } do
+-- require("dap").configurations[language] = {
+-- {
+-- type = "pwa-chrome",
+-- name = "Attach - Remote Debugging",
+-- request = "attach",
+-- program = "${file}",
+-- cwd = vim.fn.getcwd(),
+-- sourceMaps = true,
+-- protocol = "inspector",
+-- port = 9222,
+-- webRoot = "${workspaceFolder}",
+-- },
+-- {
+-- type = "pwa-chrome",
+-- name = "Launch Chrome",
+-- request = "launch",
+-- url = "http://localhost:3000",
+-- },
+-- }
+-- end
diff --git a/lua/alpha/dap/init.lua b/lua/alpha/dap/init.lua
index 44b3e50..12ea352 100644
--- a/lua/alpha/dap/init.lua
+++ b/lua/alpha/dap/init.lua
@@ -1,5 +1,7 @@
local dap, dapui, hydra = require "dap", require "dapui", require "hydra"
+dap.set_log_level('TRACE')
+
-- Setup Virtual Text
require("nvim-dap-virtual-text").setup {}
@@ -15,7 +17,7 @@ vim.fn.sign_define("DapBreakpointCondition", { text = "❓", texthl = "", linehl
vim.fn.sign_define("DapLogPoint", { text = "💬", texthl = "", linehl = "", numhl = "" })
-- UI structure
-dapui.setup {
+dapui.setup {
icons = { expanded = "▾", collapsed = "▸" },
layouts = {
{