nix-infra/modules/home/nvim/lua/plugins/lsp.lua

77 lines
1.4 KiB
Lua
Raw Permalink Normal View History

2024-03-24 18:02:32 +00:00
return {
{
"neovim/nvim-lspconfig",
opts = {
servers = {
nil_ls = {
settings = {
["nil"] = {
formatting = {
command = { "nixpkgs-fmt" },
},
},
},
},
2024-03-25 19:33:52 +00:00
rust_analyzer = {
settings = {
["rust_analyzer"] = {
check = {
command = "clippy",
},
completion = {
fullFunctionSignatures = {
enable = true,
},
},
diagnostics = {
styleLints = {
enable = true,
},
},
imports = {
granularity = {
enforce = true,
},
},
},
},
},
2024-03-26 12:04:17 +00:00
jsonls = {
-- lazy-load schemastore when needed
on_new_config = function(new_config)
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
end,
settings = {
json = {
format = {
enable = true,
},
validate = { enable = true },
},
},
},
marksman = {},
ruff_lsp = {
keys = {
{
"<leader>co",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.organizeImports" },
diagnostics = {},
},
})
end,
desc = "Organize Imports",
},
},
},
hls = {},
2024-03-24 18:02:32 +00:00
},
},
},
}