mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 16:53:00 +00:00
breaking: Remove setup script and use chezmoi
This commit is contained in:
parent
02bbb24cac
commit
0051a163c3
190 changed files with 118 additions and 3456 deletions
|
|
@ -1,33 +0,0 @@
|
|||
-- Rust
|
||||
--[[ Installation
|
||||
rustup component add rust-src
|
||||
--]]
|
||||
return {
|
||||
cmd = { "rust-analyzer" },
|
||||
filetypes = { "rust" },
|
||||
root_dir = function(bufnr, cb)
|
||||
local root = vim.fs.root(bufnr, { "Cargo.toml" })
|
||||
if root then
|
||||
vim.system({ "cargo", "metadata", "--no-depts", "--format-version", "1" }, { cwd = root }, function(obj)
|
||||
if obj.code ~= 0 then
|
||||
cb(root)
|
||||
else
|
||||
local success, result = pcall(vim.json.decode, obj.stdout)
|
||||
if success and result.workspace_root then
|
||||
cb(result.workspace_root)
|
||||
else
|
||||
cb(root)
|
||||
end
|
||||
end
|
||||
end)
|
||||
else
|
||||
cb(vim.fs.root(bufnr, { "rust-project.json", ".git" }))
|
||||
end
|
||||
end,
|
||||
before_init = function(init_params, config)
|
||||
-- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26
|
||||
if config.settings and config.settings["rust-analyzer"] then
|
||||
init_params.initializationOptions = config.settings["rust-analyzer"]
|
||||
end
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue