chore(nvim): update lspinstall config

This commit is contained in:
Oliver Davies 2021-09-28 00:07:38 +01:00
parent 896b6fe2b5
commit a77cccf2c9

View file

@ -15,28 +15,29 @@ configs.setup {
}
-- LSP
local function setup_servers()
require'lspinstall'.setup()
local servers = require'lspinstall'.installed_servers()
for _, server in pairs(servers) do
require'lspconfig'[server].setup{}
end
end
local lspconfig = require'lspconfig'
--local completion = require'completion'
setup_servers()
--local function custom_on_attach(client)
--print('Attaching to ' .. client.name)
--completion.on_attach(client)
--end
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
require'lspinstall'.post_install_hook = function ()
setup_servers()
vim.cmd("bufdo e")
end
--local default_config = {
--on_attach = custom_on_attach,
--lspconfig.intelephense.setup{
--filetypes = { "install", "inc", "module", "php", "test", "theme" },
--}
lspconfig.intelephense.setup{
filetypes = { "install", "inc", "module", "php", "test", "theme" },
}
lspconfig.tsserver.setup{
filetypes = { "js", "jsx", "vue" },
}
require'lspconfig'.vuels.setup{}
--lspconfig.tsserver.setup{
--filetypes = { "js", "jsx", "ts", "vue" },
--}
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {