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