Files
dotfiles/nvim/lua/plugins/rustaceanvim.lua
2026-06-18 11:36:12 +08:00

36 lines
1.3 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ============================================================================
-- Rust 工具 (rustaceanvim)
-- Rust 全流程LSP、调试、运行、测试、宏展开
-- ============================================================================
return {
{
"mrcjkb/rustaceanvim",
version = "^6",
lazy = false,
ft = { "rust" },
config = function()
vim.g.rustaceanvim = {
-- LSP 配置
server = {
default_settings = {
["rust-analyzer"] = {
cargo = { allFeatures = true },
check = { command = "clippy" },
},
},
},
-- DAP 适配器(复用 Mason 安装的 codelldb
dap = {
adapter = function()
local codelldb_path = vim.fn.stdpath("data") .. "/mason/bin/codelldb"
local library_path = vim.fn.stdpath("data")
.. "/mason/packages/codelldb/extension/lldb/lib/liblldb.so"
return require("rustaceanvim.config").get_codelldb_adapter(codelldb_path, library_path)
end,
},
}
end,
},
}