Updated dap to use mason
authorLukas Krickl <lukas@krickl.dev>
Fri, 28 Jul 2023 03:14:40 +0000 (05:14 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 28 Jul 2023 03:14:40 +0000 (05:14 +0200)
nvim/lua/plugin/nvim-dap.lua

index e25a24c96fbbf98f080334c3489ae94a537c3827..71673708f396a6d8f42c41bf76a0247e0c9d9eeb 100644 (file)
@@ -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')