update nvim-lspinstall to nvim-lsp-installer
This commit is contained in:
parent
3054e03fca
commit
0aafb8a2ab
@ -33,9 +33,9 @@ return require('packer').startup(function(use)
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- lsp stuff
|
-- lsp stuff
|
||||||
use {'neovim/nvim-lspconfig', event = "VimEnter"}
|
use {'neovim/nvim-lspconfig', event = "BufEnter"}
|
||||||
use {
|
use {
|
||||||
'kabouzeid/nvim-lspinstall',
|
'williamboman/nvim-lsp-installer',
|
||||||
config = function() require "plugins.lspinstall" end,
|
config = function() require "plugins.lspinstall" end,
|
||||||
after = 'nvim-lspconfig'
|
after = 'nvim-lspconfig'
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ return require('packer').startup(function(use)
|
|||||||
use {
|
use {
|
||||||
'ms-jpq/coq_nvim',
|
'ms-jpq/coq_nvim',
|
||||||
branch = 'coq',
|
branch = 'coq',
|
||||||
after = 'nvim-lspinstall',
|
after = 'nvim-lsp-installer',
|
||||||
run = ':COQdeps',
|
run = ':COQdeps',
|
||||||
config = function() require "plugins.coq" end
|
config = function() require "plugins.coq" end
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
local function setup_servers()
|
local lsp_installer = require("nvim-lsp-installer")
|
||||||
require'lspinstall'.setup()
|
|
||||||
local servers = require'lspinstall'.installed_servers()
|
|
||||||
for _, server in pairs(servers) do
|
|
||||||
require'lspconfig'[server].setup{}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
setup_servers()
|
-- Register a handler that will be called for all installed servers.
|
||||||
|
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
|
||||||
|
lsp_installer.on_server_ready(function(server)
|
||||||
|
local opts = {}
|
||||||
|
|
||||||
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
|
-- (optional) Customize the options passed to the server
|
||||||
require'lspinstall'.post_install_hook = function ()
|
-- if server.name == "tsserver" then
|
||||||
setup_servers() -- reload installed servers
|
-- opts.root_dir = function() ... end
|
||||||
vim.cmd("bufdo e") -- this triggers the FileType autocmd that starts the server
|
-- end
|
||||||
end
|
|
||||||
|
-- This setup() function is exactly the same as lspconfig's setup function.
|
||||||
|
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||||
|
server:setup(opts)
|
||||||
|
end)
|
||||||
|
|
||||||
vim.cmd(':LspStart')
|
|
||||||
|
Loading…
Reference in New Issue
Block a user