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.lua32
-rw-r--r--lua/alpha/dap/configs/elixir.lua52
-rw-r--r--lua/alpha/dap/configs/golang.lua1
-rw-r--r--lua/alpha/dap/configs/javascript.lua62
-rw-r--r--lua/alpha/dap/configs/kotlin.lua18
-rw-r--r--lua/alpha/dap/configs/php.lua27
-rw-r--r--lua/alpha/dap/configs/rust.lua57
-rw-r--r--lua/alpha/dap/init.lua108
8 files changed, 0 insertions, 357 deletions
diff --git a/lua/alpha/dap/configs/dart.lua b/lua/alpha/dap/configs/dart.lua
deleted file mode 100644
index a23c118..0000000
--- a/lua/alpha/dap/configs/dart.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-local dap = require('dap')
-
-dap.adapters.dart = {
- type = "executable",
- -- As of this writing, this functionality is open for review in https://github.com/flutter/flutter/pull/91802
- command = "flutter",
- args = {"debug_adapter"}
-}
-dap.configurations.dart = {
- {
- name = "Launch Flutter Program Linux",
- type = "dart",
- request = "launch",
- -- The nvim-dap plugin populates this variable with the filename of the current buffer
- program = "${file}",
- -- 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", "linux"}
- },
- {
- name = "Launch Flutter Program Motorola",
- type = "dart",
- request = "launch",
- -- The nvim-dap plugin populates this variable with the filename of the current buffer
- program = "${file}",
- -- 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.33:5555"}
- }
-}
diff --git a/lua/alpha/dap/configs/elixir.lua b/lua/alpha/dap/configs/elixir.lua
deleted file mode 100644
index bf732ce..0000000
--- a/lua/alpha/dap/configs/elixir.lua
+++ /dev/null
@@ -1,52 +0,0 @@
-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/golang.lua b/lua/alpha/dap/configs/golang.lua
deleted file mode 100644
index 1ec449a..0000000
--- a/lua/alpha/dap/configs/golang.lua
+++ /dev/null
@@ -1 +0,0 @@
-require("dap-go").setup()
diff --git a/lua/alpha/dap/configs/javascript.lua b/lua/alpha/dap/configs/javascript.lua
deleted file mode 100644
index 03173ba..0000000
--- a/lua/alpha/dap/configs/javascript.lua
+++ /dev/null
@@ -1,62 +0,0 @@
-local dap = require('dap')
-dap.adapters.firefox = {
- type = 'executable',
- command = 'firefox-debug-adapter',
-}
-
-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/configs/kotlin.lua b/lua/alpha/dap/configs/kotlin.lua
deleted file mode 100644
index aa486db..0000000
--- a/lua/alpha/dap/configs/kotlin.lua
+++ /dev/null
@@ -1,18 +0,0 @@
-local dap = require('dap')
-
-dap.adapters.kotlin = {
- type = 'executable';
- command = "kotlin-debug-adapter";
-}
-
-dap.configurations.kotlin = {
- {
- type = 'kotlin',
- request = 'launch',
- program = "${file}",
- name = 'Launch kotlin program',
- projectRoot = "${workspaceFolder}/app",
- mainClass = "AppKt",
- }
-}
-dap.defaults.kotlin.auto_continue_if_many_stopped = false
diff --git a/lua/alpha/dap/configs/php.lua b/lua/alpha/dap/configs/php.lua
deleted file mode 100644
index 968bb9d..0000000
--- a/lua/alpha/dap/configs/php.lua
+++ /dev/null
@@ -1,27 +0,0 @@
-local dap = require("dap")
-
-dap.adapters.php = {
- type = "executable",
- command = "php-debug-adapter",
-}
-
-dap.configurations.php = {
- {
- type = "php",
- request = "launch",
- name = "Laravel",
- port = 9003,
- pathMappings = {
- ["/var/www/html"] = "${workspaceFolder}",
- },
- },
- {
- type = "php",
- request = "launch",
- name = "Symfony",
- port = 9003,
- pathMappings = {
- ["/app"] = "${workspaceFolder}",
- },
- },
-}
diff --git a/lua/alpha/dap/configs/rust.lua b/lua/alpha/dap/configs/rust.lua
deleted file mode 100644
index 9ca976f..0000000
--- a/lua/alpha/dap/configs/rust.lua
+++ /dev/null
@@ -1,57 +0,0 @@
-local dap = require("dap")
-
-local rust_adapter = nil
-local rust_adapters = { "lldb-vscode", "codelldb" }
-for _, adapter in pairs(rust_adapters) do
- if vim.fn.executable(adapter) then
- rust_adapter = adapter
- end
-end
-
-if rust_adapter ~= nil then
- dap.adapters.lldb = {
- type = "executable",
- command = rust_adapter,
- name = "lldb",
- }
-
- dap.configurations.rust = {
- {
- name = "launch",
- type = "lldb",
- request = "launch",
- program = function()
- local dir = vim.fn.getcwd()
- return dir .. "/target/debug/" .. vim.fs.basename(dir)
- end,
- cwd = "${workspaceFolder}",
- stopOnEntry = false,
- args = function()
- local resp = vim.fn.input "Arguments: "
- if resp == "" then
- return {}
- end
-
- return vim.fn.split(resp, " ")
- end,
- },
- {
- name = "custom",
- type = "lldb",
- request = "launch",
- program = function()
- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
- end,
- cwd = "${workspaceFolder}",
- stopOnEntry = false,
- args = function()
- local resp = vim.fn.input "Arguments: "
- if resp == "" then
- return {}
- end
-
- return vim.fn.split(resp, " ")
- end,
- },
- }
-end
diff --git a/lua/alpha/dap/init.lua b/lua/alpha/dap/init.lua
deleted file mode 100644
index 12ea352..0000000
--- a/lua/alpha/dap/init.lua
+++ /dev/null
@@ -1,108 +0,0 @@
-local dap, dapui, hydra = require "dap", require "dapui", require "hydra"
-
-dap.set_log_level('TRACE')
-
--- Setup Virtual Text
-require("nvim-dap-virtual-text").setup {}
-
-for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/alpha/dap/configs/*.lua", true)) do
- loadfile(ft_path)()
-end
-
--- Signs
-vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "", linehl = "", numhl = "" })
-vim.fn.sign_define("DapStopped", { text = "▶", texthl = "", linehl = "", numhl = "" })
-vim.fn.sign_define("DapBreakpointRejected", { text = "🚫", texthl = "", linehl = "", numhl = "" })
-vim.fn.sign_define("DapBreakpointCondition", { text = "❓", texthl = "", linehl = "", numhl = "" })
-vim.fn.sign_define("DapLogPoint", { text = "💬", texthl = "", linehl = "", numhl = "" })
-
--- UI structure
-dapui.setup {
- icons = { expanded = "▾", collapsed = "▸" },
- layouts = {
- {
- elements = {
- "scopes",
- "breakpoints",
- "stacks",
- "watches",
- },
- size = 50,
- position = "right",
- },
- {
- elements = {
- "repl",
- "console",
- },
- size = 7,
- position = "bottom",
- },
- },
-}
-
--- Events Listeners
-dap.listeners.after.event_initialized["dapui_config"] = function()
- dapui.open {}
-end
-
-local hint = [[
- Nvim DAP
- _d_: Start/Continue _j_: StepOver _k_: StepOut _l_: StepInto ^
- _bp_: Toogle Breakpoint _bc_: Conditional Breakpoint ^
- _?_: log point ^
- _c_: Run To Cursor ^
- _h_: Show information of the variable under the cursor ^
- _x_: Stop Debbuging ^
- ^^ _<Esc>_
-]]
-
-hydra {
- 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 },
- { "bp", dap.toggle_breakpoint },
- { "l", dap.step_into },
- { "j", dap.step_over },
- { "k", dap.step_out },
- { "h", dapui.eval },
- { "c", dap.run_to_cursor },
- {
- "bc",
- function()
- vim.ui.input({ prompt = "Condition: " }, function(condition)
- dap.set_breakpoint(condition)
- end)
- end,
- },
- {
- "?",
- function()
- vim.ui.input({ prompt = "Log: " }, function(log)
- dap.set_breakpoint(nil, nil, log)
- end)
- end,
- },
- {
- "x",
- function()
- dap.terminate()
- dapui.close {}
- dap.clear_breakpoints()
- end,
- },
-
- { "<Esc>", nil, { exit = true } },
- },
-}