diff options
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/dap.lua | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index 3189f4f..98ae3fd 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -1,11 +1,11 @@ -local dap = require('dap') +local dap = require("dap") -- options -dap.defaults.fallback.switchbuf = 'uselast' +dap.defaults.fallback.switchbuf = "uselast" dap.defaults.fallback.focus_terminal = true dap.defaults.fallback.external_terminal = { - command = '/usr/bin/wezterm', - args = { '-e' }, + command = "/usr/bin/wezterm", + args = { "-e" }, } -- Autocmds @@ -18,31 +18,31 @@ vim.api.nvim_create_autocmd("FileType", { }) dap.adapters.cppdbg = { - id = 'cppdbg', - type = 'executable', + id = "cppdbg", + type = "executable", --command = vim.fn.stdpath('data') .. '/mason/bin/OpenDebugAD7', - command = os.getenv("HOME") .. '/apps/cpptools/extension/debugAdapters/bin/OpenDebugAD7', + command = os.getenv("HOME") .. "/apps/cpptools/extension/debugAdapters/bin/OpenDebugAD7", --command = cpptools:get_install_path() .. '/extension/debugAdapters/bin/OpenDebugAD7' } dap.adapters.codelldb = { - type = 'server', - port = '${port}', + type = "server", + port = "${port}", --host = "localhost", --host = '127.0.0.1', --port = 13000, -- 💀 Use the port printed out or specified with `--port` executable = { --command = os.getenv("HOME") .. '/apps/codelldb/extension/adapter/codelldb', command = os.getenv("HOME") .. "/.vscode-oss/extensions/vadimcn.vscode-lldb-1.9.0-universal/adapter/codelldb", - args = { '--port', '${port}' }, + args = { "--port", "${port}" }, }, --detached = true, } dap.adapters.lldb = { - type = 'executable', - command = '/usr/bin/lldb-vscode', - name = "lldb" + type = "executable", + command = "/usr/bin/lldb-vscode", + name = "lldb", } dap.configurations.cpp = { { @@ -51,9 +51,9 @@ dap.configurations.cpp = { --type = "cppdbg", type = "codelldb", request = "launch", - cwd = '${workspaceFolder}', + cwd = "${workspaceFolder}", 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, --program = '${file}', --program = function() @@ -122,16 +122,16 @@ dap.configurations.rust = dap.configurations.cpp --} dap.adapters.python = { - type = 'executable', - command = vim.trim(vim.fn.system('which python')), - args = { '-m', 'debugpy.adapter' }, + type = "executable", + command = vim.trim(vim.fn.system("which python")), + args = { "-m", "debugpy.adapter" }, } dap.configurations.python = { { -- The first three options are required by nvim-dap - type = 'python', -- the type here established the link to the adapter definition: `dap.adapters.python` - request = 'launch', + type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python` + request = "launch", name = "Launch file", -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options program = "${file}", -- This configuration will launch the current file if used. @@ -139,7 +139,7 @@ dap.configurations.python = { }, } -local dapui = require('dapui') +local dapui = require("dapui") --local dap_ui_status_ok, dapui = pcall(require, "dapui") --if not dap_ui_status_ok then -- return @@ -210,14 +210,13 @@ if not vim.g.loaded_dapui then vim.g.loaded_dapui = true end - -- Signs local sign = vim.fn.sign_define sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" }) sign("DapBreakpointCondition", { text = "◆", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }) -- -sign("DapBreakpointRejected", { text = 'R', texthl = 'DiagnosticError', numhl = 'DiagnosticError' }) +sign("DapBreakpointRejected", { text = "R", texthl = "DiagnosticError", numhl = "DiagnosticError" }) sign("DapLogPoint", { text = "L", texthl = "DapLogPoint", linehl = "", numhl = "" }) -sign('DapStopped', { text = '', texthl = 'DiagnosticSignHint', numbhl = '', linehl = '' }) +sign("DapStopped", { text = "", texthl = "DiagnosticSignHint", numbhl = "", linehl = "" }) --sign('DapBreakpoint', { text = '', texthl = 'DiagnosticSignError', numbhl = '', linehl = '' }) --sign("DapLogPoint", { text = '.>', texthl = 'DiagnosticInfo', numhl = 'DiagnosticInfo' }) @@ -238,7 +237,7 @@ dap.listeners.before.disconnect["dapui_config"] = function() dapui.close() end -require("nvim-dap-virtual-text").setup { +require("nvim-dap-virtual-text").setup({ enabled = true, enabled_commands = true, highlight_changed_variables = true, @@ -250,5 +249,5 @@ require("nvim-dap-virtual-text").setup { filter_references_pattern = "<module", virt_text_pos = "eol", all_frames = false, - virt_text_win_col = nil -} + virt_text_win_col = nil, +}) |
