diff --git a/lua/custom/plugins.lua b/lua/custom/plugins.lua index 465b971..b63a311 100644 --- a/lua/custom/plugins.lua +++ b/lua/custom/plugins.lua @@ -735,7 +735,6 @@ local plugins = { end, config = function() local dap = require "dap" - local rustcfg = require "rustaceanvim.config" local mason_registry = require "mason-registry" local codelldb_root = mason_registry.get_package("codelldb"):get_install_path() .. "/extension/" local codelldb_path = codelldb_root .. "adapter/codelldb" @@ -744,12 +743,12 @@ local plugins = { command = "/home/plex/.local/bin/kitty", args = {}, } - dap.adapters.lldb = { + dap.adapters.codelldb = { type = "server", - port = "${port}", + port = "30333", executable = { command = codelldb_path, - args = { "--port", "${port}" }, + args = { "--port", "30333" }, detached = false, }, } @@ -766,7 +765,7 @@ local plugins = { }, } dap.configurations.c = dap.configurations.cpp - -- dap.configurations.rust = dap.configurations.cpp + dap.configurations.rust = dap.configurations.cpp end, }, { @@ -795,6 +794,7 @@ local plugins = { { "folke/neodev.nvim", opts = {} }, { "mrcjkb/rustaceanvim", + enabled = true, version = "^4", -- Recommended ft = { "rust" }, }, @@ -803,6 +803,28 @@ local plugins = { lazy = false, -- PERF: this can be done more elegant config = function() require("nvim-dap-virtual-text").setup() + local dap = require "dap" + vim.g.rustaceanvim = { + -- Plugin configuration + tools = {}, + -- LSP configuration + server = { + on_attach = function(client, bufnr) + -- you can also put keymaps in here + end, + settings = { + -- rust-analyzer language server configuration + ["rust-analyzer"] = {}, + }, + }, + -- DAP configuration + dap = { + -- FIXME: the rustaceanvim debug config does not map the stdout/stderr to the + -- opened terminal, effectively rendering debugging with it useless. Luckily, + -- we can use the regular nvim-dap and nvim-dap-ui. + adapter = dap.adapters.codelldb, + }, + } end, }, }