Update LSP plugins
This commit is contained in:
parent
80be6065a8
commit
ff5d0a1d45
|
@ -1,4 +1,5 @@
|
||||||
local nvim_lsp = require('lspconfig')
|
local lspconfig = require('lspconfig')
|
||||||
|
local configs = require('lspconfig.configs')
|
||||||
|
|
||||||
-- enable snippet support
|
-- enable snippet support
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
@ -42,17 +43,19 @@ local on_attach = function(client, bufnr)
|
||||||
--require'completion'.on_attach(client, bufnr)
|
--require'completion'.on_attach(client, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local lsp_installer = require("nvim-lsp-installer")
|
||||||
|
lsp_installer.on_server_ready(function(server)
|
||||||
|
local opts = {}
|
||||||
|
|
||||||
require'lspinstall'.setup() -- important
|
-- (optional) Customize the options passed to the server
|
||||||
|
-- if server.name == "tsserver" then
|
||||||
local servers = require'lspinstall'.installed_servers()
|
-- opts.root_dir = function() ... end
|
||||||
for _, server in pairs(servers) do
|
-- end
|
||||||
require'lspconfig'[server].setup{
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
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)
|
||||||
|
|
||||||
metals_config = require("metals").bare_config()
|
metals_config = require("metals").bare_config()
|
||||||
metals_config.init_options.statusBarProvider = "on"
|
metals_config.init_options.statusBarProvider = "on"
|
||||||
|
@ -68,7 +71,7 @@ vim.cmd [[augroup end]]
|
||||||
-- map buffer local keybindings when the language server attaches
|
-- map buffer local keybindings when the language server attaches
|
||||||
local servers = { "lemminx" }
|
local servers = { "lemminx" }
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
nvim_lsp[lsp].setup {
|
lspconfig[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
flags = {
|
flags = {
|
||||||
|
|
|
@ -29,7 +29,7 @@ Plug 'mhinz/vim-signify'
|
||||||
|
|
||||||
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
Plug 'neovim/nvim-lspconfig'
|
Plug 'neovim/nvim-lspconfig'
|
||||||
Plug 'kabouzeid/nvim-lspinstall'
|
Plug 'williamboman/nvim-lsp-installer'
|
||||||
Plug 'scalameta/nvim-metals'
|
Plug 'scalameta/nvim-metals'
|
||||||
"Plug 'hrsh7th/nvim-compe'
|
"Plug 'hrsh7th/nvim-compe'
|
||||||
Plug 'hrsh7th/nvim-cmp'
|
Plug 'hrsh7th/nvim-cmp'
|
||||||
|
|
Loading…
Reference in a new issue