diff options
| -rw-r--r-- | README.md | 32 | ||||
| -rw-r--r-- | doc/nvim-lsp-installer.txt | 30 |
2 files changed, 1 insertions, 61 deletions
@@ -121,37 +121,7 @@ lsp_installer.on_server_ready(function(server) end) ``` -For more advanced use cases you may also interact with more APIs nvim-lsp-installer has to offer, for example the -following (refer to `:help nvim-lsp-installer` for more docs). - -```lua -local lsp_installer_servers = require('nvim-lsp-installer.servers') - -local servers = { - "rust_analyzer", - "clangd", - "pyright", -} - --- Loop through the servers listed above and set them up. If a server is --- not already installed, install it. -for _, server_name in pairs(servers) do - local server_available, server = lsp_installer_servers.get_server(server_name) - if server_available then - server:on_ready(function () - -- When this particular server is ready (i.e. when installation is finished or the server is already installed), - -- this function will be invoked. Make sure not to also use the "catch-all" lsp_installer.on_server_ready() - -- function to set up your servers, because by doing so you'd be setting up the same server twice. - local opts = {} - server:setup(opts) - end) - if not server:is_installed() then - -- Queue the server to be installed. - server:install() - end - end -end -``` +For more advanced use cases you may also interact with more APIs nvim-lsp-installer has to offer, refer to `:help nvim-lsp-installer` for more docs. ### Configuration diff --git a/doc/nvim-lsp-installer.txt b/doc/nvim-lsp-installer.txt index 358b8ba2..cc9d56f5 100644 --- a/doc/nvim-lsp-installer.txt +++ b/doc/nvim-lsp-installer.txt @@ -101,36 +101,6 @@ Then, somewhere in your initialization script (see `:h init.lua`): > Make sure you don't also set up your servers via lspconfig (e.g. `require("lspconfig").clangd.setup {}`)! -For more advanced use cases you may also interact with more APIs -nvim-lsp-installer has to offer, for example the following: > - - local lsp_installer_servers = require('nvim-lsp-installer.servers') - - local servers = { - "rust_analyzer", - "clangd", - "pyright", - } - - -- Loop through the servers listed above and set them up. If a server is - -- not already installed, install it. - for _, server_name in pairs(servers) do - local server_available, server = lsp_installer_servers.get_server(server_name) - if server_available then - server:on_ready(function () - -- When this particular server is ready (i.e. when installation is finished or the server is already installed), - -- this function will be invoked. Make sure not to also use the "catch-all" lsp_installer.on_server_ready() - -- function to set up your servers, because by doing so you'd be setting up the same server twice. - local opts = {} - server:setup(opts) - end) - if not server:is_installed() then - -- Queue the server to be installed. - server:install() - end - end - end -< ============================================================================== COMMANDS *nvim-lsp-installer-commands* |
