aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-05-02 03:07:08 +0200
committerGitHub <noreply@github.com>2022-05-02 03:07:08 +0200
commit18227c824dac3bb5c672469acd0f3b9b2a90edd1 (patch)
tree883daec1e6251d21c5be611051c076321d007fe6
parentAdd robotframework_ls (#655) (diff)
downloadmason-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)
-rw-r--r--.github/ISSUE_TEMPLATE/server_installation_form.yaml2
-rw-r--r--README.md59
2 files changed, 56 insertions, 5 deletions
diff --git a/.github/ISSUE_TEMPLATE/server_installation_form.yaml b/.github/ISSUE_TEMPLATE/server_installation_form.yaml
index 5102ef99..e38a86fd 100644
--- a/.github/ISSUE_TEMPLATE/server_installation_form.yaml
+++ b/.github/ISSUE_TEMPLATE/server_installation_form.yaml
@@ -1,5 +1,5 @@
name: Server installation issue
-description: Report an issue with installing a server via nvim-lsp-installer
+description: Report an issue that occurs during the installation of a server
labels:
- installation-issue
diff --git a/README.md b/README.md
index ba892739..60eca8ef 100644
--- a/README.md
+++ b/README.md
@@ -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