From ee637b2920f0afd99fd1dd4d363d91be0cb41e07 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 28 Jul 2023 05:14:40 +0200 Subject: [PATCH] Updated dap to use mason --- nvim/lua/plugin/nvim-dap.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/nvim/lua/plugin/nvim-dap.lua b/nvim/lua/plugin/nvim-dap.lua index e25a24c..7167370 100644 --- a/nvim/lua/plugin/nvim-dap.lua +++ b/nvim/lua/plugin/nvim-dap.lua @@ -1,5 +1,7 @@ require("dapui").setup() +local path = vim.fn.stdpath('data') + local dap = require('dap') dap.adapters.lldb = { @@ -8,10 +10,23 @@ dap.adapters.lldb = { name = 'lldb' } +dap.adapters.codelldb = { + type = 'server', + port = "${port}", + executable = { + -- CHANGE THIS to your path! + command = path .. '/mason/bin/codelldb', + args = { "--port", "${port}" }, + + -- On windows you may have to uncomment this: + -- detached = false, + } +} + dap.configurations.cpp = { { name = 'Launch', - type = 'lldb', + type = 'codelldb', request = 'launch', program = function() return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') -- 2.30.2