From 4613344d6ec42b94221d5297947e6d82eaeca31d Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 12 Feb 2022 23:48:09 +0100 Subject: docs: remove "advanced" example snippet There wasn't much thought put into this snippet, it was just added as an example of what one could do. The snippet happens to demonstrate how to automatically install servers - this is however already documented (in a different fashion) in the Wiki. --- README.md | 32 +------------------------------- doc/nvim-lsp-installer.txt | 30 ------------------------------ 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/README.md b/README.md index 9f121c23..b78cf5dc 100644 --- a/README.md +++ b/README.md @@ -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* -- cgit v1.2.3-70-g09d2