diff options
| author | William Boman <william@redwill.se> | 2022-05-02 03:07:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-02 03:07:08 +0200 |
| commit | 18227c824dac3bb5c672469acd0f3b9b2a90edd1 (patch) | |
| tree | 883daec1e6251d21c5be611051c076321d007fe6 /README.md | |
| parent | Add robotframework_ls (#655) (diff) | |
| download | mason-18227c824dac3bb5c672469acd0f3b9b2a90edd1.tar mason-18227c824dac3bb5c672469acd0f3b9b2a90edd1.tar.gz mason-18227c824dac3bb5c672469acd0f3b9b2a90edd1.tar.bz2 mason-18227c824dac3bb5c672469acd0f3b9b2a90edd1.tar.lz mason-18227c824dac3bb5c672469acd0f3b9b2a90edd1.tar.xz mason-18227c824dac3bb5c672469acd0f3b9b2a90edd1.tar.zst mason-18227c824dac3bb5c672469acd0f3b9b2a90edd1.zip | |
docs: mention what not do with packer (#657)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 59 |
1 files changed, 55 insertions, 4 deletions
@@ -70,16 +70,21 @@ install _all_ servers are: ```lua use { - 'neovim/nvim-lspconfig', - 'williamboman/nvim-lsp-installer', + "williamboman/nvim-lsp-installer", + { + "neovim/nvim-lspconfig", + setup = function() + require("nvim-lsp-installer").setup {} + end + } } ``` ### vim-plug ```vim -Plug 'neovim/nvim-lspconfig' -Plug 'williamboman/nvim-lsp-installer' +Plug "williamboman/nvim-lsp-installer" +Plug "neovim/nvim-lspconfig" ``` ## Usage @@ -93,6 +98,52 @@ function before you set up any servers with `lspconfig`**! require("nvim-lsp-installer").setup {} ``` +<details> +<summary> +Important if you use packer.nvim! (click to expand) +</summary> + +<br /> + +> Do not separate the nvim-lsp-installer setup from lspconfig, for example via the `config` hook. +> Make sure to colocate the nvim-lsp-installer setup with the lspconfig setup. This is because load order of plugins is +not guaranteed, leading to nvim-lsp-installer's `config` function potentially executing after lspconfig's. +> +> ❌ Do not do this: +```lua +use { + { + "williamboman/nvim-lsp-installer", + config = function() + require("nvim-lsp-installer").setup {} + end + }, + { + "neovim/nvim-lspconfig", + config = function() + local lspconfig = require("lspconfig") + lspconfig.sumneko_lua.setup {} + end + }, +} +``` +> ✅ Instead, do this: +```lua +use { + "williamboman/nvim-lsp-installer", + { + "neovim/nvim-lspconfig", + config = function() + require("nvim-lsp-installer").setup {} + local lspconfig = require("lspconfig") + lspconfig.sumneko_lua.setup {} + end + } +} +``` + +</details> + Refer to the [Configuration](#configuration) section for information about which settings are available. ### Commands |
