This commit is contained in:
Miguel Palhas
2025-09-18 13:41:41 +01:00
parent 77f65f1654
commit 0a6431139a
+26 -20
View File
@@ -11,12 +11,6 @@ M.defaults = function()
local servers = { "html", "lua_ls", "biome", "solidity_ls_nomicfoundation", "tinymist" }
vim.lsp.inlay_hint.enable()
-- vim.lsp.handlers["textDocument/codeAction"] = vim.lsp.handlers.code_action
-- border = "rounded", -- You can also use 'single', 'double', 'solid', etc.
-- })
-- vim.diagnostic.config { virtual_text = true }
-- vim.lsp.handlers["textDocument/publishDiagnostics"] =
-- vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false })
for _, lsp in ipairs(servers) do
lspconfig(lsp, {
@@ -28,7 +22,26 @@ M.defaults = function()
end
vim.diagnostic.config {
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.HINT] = "",
[vim.diagnostic.severity.INFO] = "",
},
},
update_in_insert = true,
underline = true,
severity_sort = true,
virtual_text = false,
float = {
focusable = false,
style = "minimal",
border = "single",
header = "",
prefix = "",
suffix = "",
},
}
end
@@ -54,18 +67,15 @@ end
M.rustacean = {
server = {
-- cmd = function()
-- return { "ra-multiplex" }
-- end,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
default_settings = {
["rust-analyzer"] = {
check = { command = "clippy" },
checkOnSave = true,
cargo = {
targetDir = true,
extraArgs = { "--edition=2024" },
-- extraArgs = { "--edition=2024" },
},
diagnostics = {
disabled = { "inactive-code", "macro-error" },
@@ -75,13 +85,9 @@ M.rustacean = {
on_attach = function(client, bufnr)
M.on_attach(client, bufnr)
local function opts(desc)
return { buffer = bufnr, desc = "LSP " .. desc }
end
map("n", "ga", function()
vim.cmd.RustLsp "codeAction"
end, opts "Rust Code Actions")
end, { buffer = bufnr })
end,
},
tools = {
@@ -107,9 +113,9 @@ M.typescript = {
client.server_capabilities.documentFormattingProvider = false
end,
},
handlers = {
["textDocument/publishDiagnostics"] = vim.diagnostic.config { virtual_text = false },
},
-- handlers = {
-- ["textDocument/publishDiagnostics"] = vim.diagnostic.config { virtual_text = false },
-- },
}
return M