You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- improve overview for newcomers
- call out plan for upstreaming "framework" parts to Nvim core
- guide bug reports to neovim core
- remove most mentions of wiki
fix#3202
Copy file name to clipboardExpand all lines: README.md
+33-37Lines changed: 33 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,30 @@
1
1
# nvim-lspconfig
2
2
3
-
[Configs](doc/server_configurations.md) for the [Nvim LSP client](https://neovim.io/doc/user/lsp.html) (`:help lsp`).
3
+
nvim-lspconfig is a "data only" repo, providing basic, default [Nvim LSP client](https://neovim.io/doc/user/lsp.html)
4
+
configurations for various LSP servers.
4
5
5
-
***Do not file Nvim LSP client issues here.** The Nvim LSP client does not live here. This is only a collection of LSP configs.
6
-
* If you found a bug in the Nvim LSP client, [report it at the Nvim core repo](https://github.com/neovim/neovim/issues/new?assignees=&labels=bug%2Clsp&template=lsp_bug_report.yml).
7
-
* These configs are **best-effort and supported by the community.** See [contributions](#contributions).
6
+
View the [documentation for all configs](doc/server_configurations.md) or `:help lspconfig-all` from Nvim.
7
+
8
+
## Important ⚠️
8
9
9
-
See also `:help lspconfig`.
10
+
* If you found a bug in the Nvim LSP functionality (`:help lsp`), [report it to Neovim core](https://github.com/neovim/neovim/issues/new?assignees=&labels=bug%2Clsp&template=lsp_bug_report.yml).
11
+
***Do not** report it here. Only configuration data lives here.
12
+
* These configs are **best-effort and supported by the community.** See [contributions](#contributions).
13
+
***Note:** This repo only provides *configurations*. Its programmatic API is deprecated and should not be used externally.
14
+
*[Work is planned](https://github.com/neovim/neovim/issues/28479) to selectively upstream the
15
+
"framework" parts (*not* the configs) of nvim-lspconfig, to Nvim core, and deprecate them in
* Or use a 3rd-party plugin manager (consult the documentation for your plugin manager).
22
28
23
29
## Quickstart
24
30
@@ -36,25 +42,22 @@ See also `:help lspconfig`.
36
42
```
37
43
4. Run `:checkhealth lsp` to see the status or to troubleshoot.
38
44
39
-
See [server_configurations.md](doc/server_configurations.md) (`:help lspconfig-all` from Nvim) for the full list of configs, including installation instructions and additional, optional, customization suggestions for each language server. For servers that are not on your system path (e.g., `jdtls`, `elixirls`), you must manually add `cmd` to the `setup` parameter. Most language servers can be installed in less than a minute.
45
+
Read `:help lspconfig` for details. Read `:help lspconfig-all` for the full list of server-specific details.
46
+
For servers not on your `$PATH` (e.g., `jdtls`, `elixirls`), you must manually set the `cmd` parameter when calling `setup()`.
40
47
41
48
## Configuration
42
49
43
-
Nvim sets some default options whenever a buffer attaches to an LSP client. See [`:h lsp-config`][lsp-config] for more details. In particular, the following options are set:
50
+
Nvim sets some default options and mappings when a buffer attaches to LSP (see [`:help lsp-config`][lsp-config]). In particular:
44
51
45
52
*[`'tagfunc'`][tagfunc]
46
-
- Enables "go to definition" capabilities using [`<C-]>`][tagjump] and other [tag commands][tag-commands].
53
+
- Enables "go to definition" capabilities using [`<C-]>`][tagjump] and other [tag commands][tag-commands].
47
54
*[`'omnifunc'`][omnifunc]
48
-
- Enables (manual) omni mode completion with `<C-X><C-O>` in Insert mode. For *auto*completion, an [autocompletion plugin](https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion) is required.
55
+
- Enables (manual) omni mode completion with `<C-X><C-O>` in Insert mode. For *auto*completion, an [autocompletion plugin](https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion) is required.
49
56
*[`'formatexpr'`][formatexpr]
50
-
- Enables LSP formatting with [`gq`][gq].
51
-
52
-
Nvim also maps `K` to [`vim.lsp.buf.hover()`][vim.lsp.buf.hover] in Normal mode.
53
-
54
-
Nvim 0.10 and newer creates the following default maps unconditionally:
55
-
56
-
*`[d` and `]d` map to `vim.diagnostic.goto_prev()` and `vim.diagnostic.goto_next()` (respectively)
57
-
*`<C-W>d` maps to `vim.diagnostic.open_float()`
57
+
- Enables LSP formatting with [`gq`][gq].
58
+
*`K` maps to [`vim.lsp.buf.hover()`][vim.lsp.buf.hover] in Normal mode.
59
+
*`[d` and `]d` map to `vim.diagnostic.goto_prev()` and `vim.diagnostic.goto_next()`, respectively.
If you have an issue, the first step is to reproduce with a [minimal configuration](https://github.com/neovim/nvim-lspconfig/blob/master/test/minimal_init.lua).
92
-
93
94
The most common reasons a language server does not start or attach are:
94
95
95
-
1.The language server is not installed. nvim-lspconfig does not install language servers for you. You should be able to run the `cmd` defined in each server's Lua module from the command line and see that the language server starts. If the `cmd` is an executable name instead of an absolute path to the executable, ensure it is on your path.
96
+
1.Language server is not installed. nvim-lspconfig does not install language servers for you. You should be able to run the `cmd` defined in each server's Lua module from the command line and see that the language server starts. If the `cmd` is an executable name instead of an absolute path to the executable, ensure it is on your path.
96
97
2. Missing filetype plugins. Certain languages are not detecting by vim/neovim because they have not yet been added to the filetype detection system. Ensure `:set ft?` shows the filetype and not an empty value.
97
98
3. Not triggering root detection. **Some** language servers will only start if it is opened in a directory, or child directory, containing a file which signals the *root* of the project. Most of the time, this is a `.git` folder, but each server defines the root config in the lua file. See [server_configurations.md](doc/server_configurations.md) or the source for the list of root directories.
98
99
4. You must pass `capabilities` for **each**`setup {}` if you want these to take effect.
99
100
5.**Do not call `setup {}` twice for the same server**. The second call to `setup {}` will overwrite the first.
100
101
102
+
## Bug reports
103
+
104
+
If you found a bug with LSP functionality, [report it to Neovim core](https://github.com/neovim/neovim/issues/new?assignees=&labels=bug%2Clsp&template=lsp_bug_report.yml).
105
+
101
106
Before reporting a bug, check your logs and the output of `:LspInfo`. Add the following to your init.vim to enable logging:
102
107
103
108
```lua
@@ -118,18 +123,9 @@ Most of the time, the reason for failure is present in the logs.
118
123
*`:LspStop <client_id>` Defaults to stopping all buffer clients.
119
124
*`:LspRestart <client_id>` Defaults to restarting all buffer clients.
120
125
121
-
## Wiki
122
-
123
-
See the [wiki](https://github.com/neovim/nvim-lspconfig/wiki) for additional topics, including:
124
-
125
-
*[Automatic server installation](https://github.com/neovim/nvim-lspconfig/wiki/Installing-language-servers#automatically)
0 commit comments