Move lspconfig from lua to nix
This commit is contained in:
parent
e4b7645102
commit
e30d42e8f2
4 changed files with 137 additions and 77 deletions
home/features/neovim/config
|
@ -30,6 +30,7 @@
|
|||
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
|
||||
"lean": { "branch": "main", "commit": "1a2a2dfbc7e6775e9ec8b84e5eadaf31fde1894e" },
|
||||
"live-command": { "branch": "main", "commit": "d460067d47948725a6f25b20f31ea8bbfdfe4622" },
|
||||
"lspconfig": { "branch": "master", "commit": "16295b79410f131c4fa7870c663b4ace6a761fb2" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"luasnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
|
||||
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
|
||||
|
@ -40,12 +41,12 @@
|
|||
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
|
||||
"navigator": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
|
||||
"neoconf": { "branch": "main", "commit": "4ef6c6c5882e7e16209173fb8c47414202843384" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "b0ccf605c952eb0d1efe3692d5b241c52ceee187" },
|
||||
"neodev": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
|
||||
"nui": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
|
||||
"null-ls": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "6b9f4bbe0aa1f351fd4845dc5fd4f3450b010f88" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" },
|
||||
"plenary": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
|
||||
"purescript": { "branch": "main", "commit": "82348352e6568fcc0385bd7c99a8ead3a479feea" },
|
||||
"rust-tools": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
|
||||
"scrap": { "branch": "main", "commit": "cc8453ed613932c744c3d1ec42f379b78bd8b92c" },
|
||||
"ssr": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
|
||||
|
|
|
@ -1,135 +0,0 @@
|
|||
local runtime = require("my.tempest")
|
||||
|
||||
local M = {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"neoconf",
|
||||
{
|
||||
"folke/neodev.nvim",
|
||||
config = true,
|
||||
},
|
||||
},
|
||||
cond = runtime.blacklist("vscode"),
|
||||
}
|
||||
|
||||
-- {{{ Capabilities
|
||||
M.capabilities = function()
|
||||
local c = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- Add folding capabilities
|
||||
c.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true,
|
||||
}
|
||||
|
||||
return c
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Main config function
|
||||
function M.config()
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- {{{ General server config
|
||||
---@type lspconfig.options
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
local servers = {
|
||||
-- {{{ Typescript
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
tsserver = {
|
||||
on_attach = function(client)
|
||||
-- We handle formatting using null-ls and prettierd
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
end,
|
||||
},
|
||||
-- }}}
|
||||
-- {{{ Purescript
|
||||
purescriptls = {
|
||||
root_dir = lspconfig.util.root_pattern("spago.yaml"),
|
||||
settings = {
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
purescript = {
|
||||
censorWarnings = {
|
||||
"UnusedName",
|
||||
"ShadowedName",
|
||||
"UserDefinedWarning",
|
||||
},
|
||||
formatter = "purs-tidy",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- }}}
|
||||
-- {{{ Lua
|
||||
lua_ls = {
|
||||
cmd = {
|
||||
"lua-language-server",
|
||||
"--logpath=/home/adrielus/.local/share/lua-language-server/log",
|
||||
},
|
||||
settings = {
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
Lua = {
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
format = {
|
||||
enable = true,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- }}}
|
||||
-- {{{ Latex
|
||||
texlab = {
|
||||
settings = {
|
||||
texlab = {
|
||||
build = {
|
||||
args = {
|
||||
-- Here by default:
|
||||
"-pdf",
|
||||
"-interaction=nonstopmode",
|
||||
"-synctex=1",
|
||||
"%f",
|
||||
-- Required for syntax highlighting inside the generated pdf aparently
|
||||
"-shell-escape",
|
||||
},
|
||||
executable = "latexmk",
|
||||
forwardSearchAfter = true,
|
||||
onSave = true,
|
||||
},
|
||||
chktex = {
|
||||
onOpenAndSave = true,
|
||||
onEdit = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- }}}
|
||||
-- {{{ Nix
|
||||
rnix = {},
|
||||
-- nil_ls = {},
|
||||
nixd = {},
|
||||
-- }}}
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
cssls = {},
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
jsonls = {},
|
||||
dhall_lsp_server = {},
|
||||
typst_lsp = {
|
||||
exportPdf = "onType",
|
||||
},
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
elmls = {},
|
||||
}
|
||||
-- }}}
|
||||
|
||||
local capabilities = M.capabilities()
|
||||
for lsp, details in pairs(servers) do
|
||||
details.capabilities = capabilities
|
||||
lspconfig[lsp].setup(details)
|
||||
end
|
||||
end
|
||||
--}}}
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue