nvim: Add remote launch option for rust

This commit is contained in:
Oshgnacknak 2025-07-31 15:36:51 +02:00
parent 3e351df241
commit d3f8b0dc54
Signed by: Oshgnacknak
GPG key ID: 8CB7375654585956

View file

@ -5,27 +5,48 @@ dapui.setup({})
dap.adapters.codelldb = {
type = 'server',
host = '127.0.0.1',
port = "${port}",
executable = {
-- Change this to your path!
command = '/usr/bin/codelldb',
args = {"--port", "${port}"},
}
}
dap.configurations.rust= {
dap.configurations.rust = {
{
name = "Launch file",
name = "Remote Launch",
type = "codelldb",
request = "launch",
args = {
"platform select remote-linux", -- For example: 'remote-linux', 'remote-macosx', 'remote-android', etc.
"platform connect connect://localhost:13000",
},
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
attachCommands = {
"platform select remote-linux",
"platform connect connect://localhost:13000",
},
cwd = '${workspaceFolder}',
stopOnEntry = false,
},
}
-- 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,
-- },
-- }
vim.keymap.set('n', '<Leader>dc', function() dap.continue() end)
vim.keymap.set('n', '<F10>', function() dap.step_over() end)
vim.keymap.set('n', '<F11>', function() dap.step_into() end)