add rust and golang with debugger

This commit is contained in:
2024-03-19 02:51:01 +00:00
parent 536c55e499
commit 87100b9fbf
7 changed files with 102 additions and 8 deletions

View File

@ -16,6 +16,7 @@ local options = {
markdown = { prettier },
nix = { "alejandra" },
go = { "goimports", "gofumpt" },
rust = { "rust_analyzer" },
},
format_on_save = {

View File

@ -0,0 +1,16 @@
require("dapui").setup()
local dap, dapui = require("dap"), require("dapui")
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end

View File

@ -0,0 +1,5 @@
require("go").setup({
trouble = true,
icons = { breakpoint = "", currentpos = "" },
gocoverage_sign = "",
})

View File

@ -21,6 +21,9 @@ M.treesitter = {
"gomod",
"gowork",
"gosum",
-- rust
"rust",
},
}
@ -44,13 +47,9 @@ M.mason = {
-- go
"gopls",
"goimports",
"gofumpt",
"gomodifytags",
"impl",
"iferr",
"staticcheck",
"delve",
-- rust
"codelldb",
},
}

View File

@ -0,0 +1,17 @@
local configs = require("nvchad.configs.lspconfig")
local on_attach = configs.on_attach
local capabilities = configs.capabilities
vim.g.rustaceanvim = {
server = {
on_attach = on_attach,
capabilities = capabilities,
default_settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
},
},
},
}