feat: refactor lsp configs and drop nvim-cmp

This commit is contained in:
2025-11-15 05:59:28 +01:00
parent ee07734ee8
commit e715992cce
17 changed files with 531 additions and 796 deletions
+54
View File
@@ -0,0 +1,54 @@
local lsp = require("lsp")
---@type vim.lsp.Config
return {
on_attach = function(client, bufnr)
lsp.on_attach(client, bufnr)
local handler_name = "textDocument/publishDiagnostics"
local default_handler = client.handlers[handler_name]
or vim.lsp.handlers[handler_name]
client.handlers[handler_name] = function(err, result, context, config)
if result and result.diagnostics then
result.diagnostics = vim.tbl_filter(function(diagnostic)
return diagnostic.severity < vim.diagnostic.severity.HINT
end, result.diagnostics)
end
default_handler(err, result, context, config)
end
end,
settings = {
["rust-analyzer"] = {
check = {
command = "clippy",
extraArgs = {
"--",
"-Wclippy::pedantic",
},
},
diagnostics = {
styleLints = {
enable = true,
},
},
imports = {
prefix = "self",
},
inlayHints = {
chainingHints = {
enable = false,
},
parameterHints = {
enable = false,
},
typeHints = {
enable = false,
},
},
rustfmt = {
extraArgs = { "+nightly" },
},
},
},
}