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 --- tests/minimal_debug_init.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'tests/minimal_debug_init.lua') diff --git a/tests/minimal_debug_init.lua b/tests/minimal_debug_init.lua index cd42ed24..f090b353 100644 --- a/tests/minimal_debug_init.lua +++ b/tests/minimal_debug_init.lua @@ -32,25 +32,21 @@ local function load_plugins() end function _G.load_config() - -- ================================================== - -- ======= MODIFY YOUR CONFIG HERE, IF NEEDED ======= - -- ================================================== - local lsp_installer = require "nvim-lsp-installer" + local lspconfig = require "lspconfig" local function on_attach(client, bufnr) vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") end - require("nvim-lsp-installer").settings { + require("nvim-lsp-installer").setup { log = vim.log.levels.DEBUG, } - lsp_installer.on_server_ready(function(server) - server:setup { - on_attach = on_attach, - } - end) -- ================================================== + -- ========= SETUP RELEVANT SERVER(S) HERE! ========= + -- ================================================== + -- + -- lspconfig.sumneko_lua.setup { on_attach = on_attach } end if vim.fn.isdirectory(install_path) == 0 then -- cgit v1.2.3-70-g09d2