初始化dotfiles
This commit is contained in:
35
nvim/lua/plugins/rustaceanvim.lua
Normal file
35
nvim/lua/plugins/rustaceanvim.lua
Normal file
@ -0,0 +1,35 @@
|
||||
-- ============================================================================
|
||||
-- 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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user