From 090c8a87b31de5c5a21eebc55adb22ddab625015 Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 27 Apr 2022 21:20:45 +0200 Subject: feat: integrate with lspconfig's on_setup hook (#631) * feat: integrate with lspconfig's on_setup hook * fix!: don't use aliased installation directories if new .setup() fn is used This makes it so servers are always installed in a directory name that corresponds with the server name. The reason aliased installation directories is supported is lost on me, but it's legacy and complicates things unnecessarily. This is a breaking change for users who previously were using the `.on_server_ready()` hook, and now transitioned to setting up servers directly via lspconfig. These users will need to reinstall the server. * fix: block usage of the deprecated server:setup() method if new setup method is used * fix: allow passing no arg to setup() * docs: ok final.v3 readme --- lua/nvim-lsp-installer/server.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lua/nvim-lsp-installer/server.lua') diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua index de6481a4..66d9655f 100644 --- a/lua/nvim-lsp-installer/server.lua +++ b/lua/nvim-lsp-installer/server.lua @@ -71,6 +71,10 @@ end ---Sets up the language server and attaches all open buffers. ---@param opts table @The lspconfig server configuration. function M.Server:setup(opts) + assert( + not settings.uses_new_setup, + "Please set up servers directly via lspconfig instead of going through nvim-lsp-installer (this method is now deprecated)! Refer to :h nvim-lsp-installer-quickstart for more information." + ) self:setup_lsp(opts) if not (opts.autostart == false) then self:attach_buffers() -- cgit v1.2.3-70-g09d2