linuxware/modules/home-manager/programs/neovim/lua/plugins/nvim-dap.lua
Alexandre Cavalheiro S. Tiago da Silva a2ff5d1b6a
fix(neovim): use getnixpath util for nvim-dap and lsp, move polish
This moves polish.lua to `lua/`, creates a util.lua file to be loaded
before lazy.nvim so we can use the `getnixpath` util everywhere, and
replaces in polish.lua and lsp.lua the template strings for substitution
with a `getnixpath` equivalent
2025-02-17 19:00:25 -03:00

85 lines
2.1 KiB
Lua

---@type LazySpec
return {
"mfussenegger/nvim-dap",
config = function()
local dap = require "dap"
---@type dap.Adapter
dap.adapters.codelldb = {
port = "${port}",
type = "server",
executable = {
command = "codelldb",
args = { "--port", "${port}" },
},
}
---@type dap.Configuration[]
dap.configurations.rust = {
{
name = "Launch file",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
},
}
---@type dap.Adapter
dap.adapters.cppdbg = {
id = "cppdbg",
type = "executable",
command = vim.fn.getnixpath "vscode-extensions.ms-vscode.cpptools"
.. "/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7",
}
---@type dap.Configuration[]
dap.configurations.cpp = {
{
name = "Launch file",
type = "cppdbg",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopAtEntry = true,
},
{
name = "Attach to gdbserver :1234",
type = "cppdbg",
request = "launch",
MIMode = "gdb",
miDebuggerServerAddress = "localhost:1234",
miDebuggerPath = "/usr/bin/gdb",
cwd = "${workspaceFolder}",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
},
}
dap.configurations.c = dap.configurations.cpp
---@type dap.Adapter
dap.adapters.godot = {
type = "server",
host = "127.0.0.1",
port = 6006,
}
---@type dap.Configuration[]
dap.configurations.gdscript = {
{
name = "Launch scene",
type = "godot",
request = "launch",
project = "${workspaceFolder}",
scene = "current",
},
}
end,
}