mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
- Use `rustaceanvim` for Rust development - `rustaceanvim` keymaps in NeoVim `after` file - Remove Rust LSP setup through builtin LSP - Remove LSP installations from Mason when equivalent available through OS installers - All LSP plugins in `code-lsp.lua`
85 lines
3.0 KiB
Lua
85 lines
3.0 KiB
Lua
return {
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
cond = require("config.util").is_not_vscode(),
|
|
dependencies = {
|
|
{ "williamboman/mason.nvim", config = true }, -- NOTE: Must be loaded before dependants
|
|
"williamboman/mason-lspconfig.nvim",
|
|
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
|
"saghen/blink.cmp",
|
|
},
|
|
config = function()
|
|
local servers = {}
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
|
-- NOTE: `nvim-lspconfig` has default LSP configs in its DB which saves time
|
|
-- Useful even after NeoVim 0.11, which made LSP setup much easier
|
|
-- Configs in `nvim/lsp/*` are APPENDED to each LSP setup here
|
|
require("mason-lspconfig").setup({
|
|
handlers = {
|
|
function(server_name)
|
|
local server = servers[server_name] or {}
|
|
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
|
server.inlay_hints = { enabled = true }
|
|
server.diagnostics = {
|
|
underline = true,
|
|
update_in_insert = false,
|
|
severity_sort = true,
|
|
}
|
|
require("lspconfig")[server_name].setup(server)
|
|
end,
|
|
},
|
|
})
|
|
end,
|
|
},
|
|
|
|
{
|
|
"j-hui/fidget.nvim",
|
|
cond = require("config.util").is_not_vscode(),
|
|
opts = {
|
|
progress = {
|
|
poll_rate = 1, -- How and when to poll for progress messages
|
|
suppress_on_insert = true, -- Suppress new messages while in insert mode
|
|
ignore_done_already = true, -- Ignore new tasks that are already complete
|
|
ignore_empty_message = true, -- Ignore new tasks that don't contain a message
|
|
ignore = {}, -- List of LSP servers to ignore
|
|
|
|
display = {
|
|
render_limit = 1, -- How many LSP messages to show at once
|
|
-- skip_history = true, -- Whether progress notifications should be omitted from history
|
|
},
|
|
},
|
|
|
|
notification = {
|
|
poll_rate = 2, -- How often to udate and render notifications
|
|
filter = vim.log.levels.WARN, -- Minimum notifications level
|
|
window = { winblend = 0 },
|
|
},
|
|
},
|
|
},
|
|
|
|
-- Rust
|
|
{
|
|
"mrcjkb/rustaceanvim",
|
|
version = "^6",
|
|
config = function()
|
|
vim.g.rusteceanvim = {
|
|
dap = {
|
|
adapter = {
|
|
type = "executable",
|
|
command = "codelldb",
|
|
name = "codelldb",
|
|
},
|
|
},
|
|
}
|
|
end,
|
|
},
|
|
{
|
|
"saecki/crates.nvim",
|
|
tag = "stable",
|
|
config = function()
|
|
require("crates").setup()
|
|
end,
|
|
},
|
|
}
|