🪴 my neovim config:)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(config/ivy/config/lsp): create lsp module

robin bf832843 4e0242be

+43
+43
config/lua/ivy/config/lsp.lua
··· 1 + local makeopt = require("chai.options").makeopt 2 + 3 + return { 4 + options = { 5 + common = makeopt({ 6 + {}, 7 + "common server config", 8 + { "table", "callable" }, 9 + }), 10 + servers = makeopt({ 11 + {}, 12 + "lsp servers to configure", 13 + { "table", "callable" }, 14 + }), 15 + on_attach = makeopt({ 16 + default = nil, 17 + description = "callback after lsp attaches", 18 + validator = "callable", 19 + optional = true, 20 + }), 21 + }, 22 + setup = function(props) 23 + vim.api.nvim_create_autocmd("LspAttach", { 24 + group = vim.api.nvim_create_augroup("LspAttach", { clear = true }), 25 + callback = props.on_attach, 26 + }) 27 + 28 + local common = props.common 29 + if type(common) == "function" then 30 + common = common() 31 + end 32 + 33 + vim.lsp.config("*", common) 34 + 35 + local servers = props.servers 36 + if type(servers) == "function" then 37 + servers = servers() 38 + end 39 + 40 + ---@diagnostic disable-next-line: param-type-mismatch 41 + vim.iter(pairs(servers)):each(vim.lsp.config) 42 + end, 43 + }