nvim: Improve LSP stuff

This commit is contained in:
2024-09-13 13:00:39 +02:00
parent 2458565137
commit fd0c14dc0c
6 changed files with 254 additions and 31 deletions

View File

@ -1,12 +1,10 @@
-- change rust-analyzer target
-- change rust-analyzer target and restart
set_rust_target = function(target)
vim.g["rust-analyzer-target"] = target
vim.cmd("RustAnalyzer restart")
print("rust-analyzer.cargo.target = " .. target)
require("rust-tools").setup({
server = { settings = { ["rust-analyzer"] = { cargo = { target = target } } } },
})
end
-- a custom telescope picker for changing rust-analyzer target
pick_rust_target = function(opts)
opts = opts or {}
require("telescope.pickers").new(opts, {
@ -24,3 +22,5 @@ pick_rust_target = function(opts)
end,
}):find()
end