You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/book/src
Philipp Mildenberger 71551d395b Adds support for multiple language servers per language.
Language Servers are now configured in a separate table in `languages.toml`:

```toml
[langauge-server.mylang-lsp]
command = "mylang-lsp"
args = ["--stdio"]
config = { provideFormatter = true }

[language-server.efm-lsp-prettier]
command = "efm-langserver"

[language-server.efm-lsp-prettier.config]
documentFormatting = true
languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${INPUT}", formatStdin = true } ] }
```

The language server for a language is configured like this (`typescript-language-server` is configured by default):

```toml
[[language]]
name = "typescript"
language-servers = [ { name = "efm-lsp-prettier", only-features = [ "format" ] }, "typescript-language-server" ]
```

or equivalent:

```toml
[[language]]
name = "typescript"
language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ]
```

Each requested LSP feature is priorized in the order of the `language-servers` array.
For example the first `goto-definition` supported language server (in this case `typescript-language-server`) will be taken for the relevant LSP request (command `goto_definition`).

If no `except-features` or `only-features` is given all features for the language server are enabled, as long as the language server supports these. If it doesn't the next language server which supports the feature is tried.

The list of supported features are:

- `format`
- `goto-definition`
- `goto-declaration`
- `goto-type-definition`
- `goto-reference`
- `goto-implementation`
- `signature-help`
- `hover`
- `document-highlight`
- `completion`
- `code-action`
- `workspace-command`
- `document-symbols`
- `workspace-symbols`
- `diagnostics`
- `rename-symbol`
- `inlay-hints`

Another side-effect/difference that comes with this PR, is that only one language server instance is started if different languages use the same language server.
2 years ago
..
generated Adds support for multiple language servers per language. 2 years ago
guides Adds support for multiple language servers per language. 2 years ago
SUMMARY.md inject language based on file extension & shebang (#3970) 2 years ago
commands.md Rewrite and refactor all documentation (#5534) 2 years ago
configuration.md feat: add a config option to exclude declaration from LSP references (#6886) 2 years ago
from-vim.md Fix minor grammar issue in 'from-vim' docs (#6667) 2 years ago
install.md Add Flathub as third party repository (#6994) 2 years ago
keymap.md Fix keymap select / extend mode anchor link (#6974) 2 years ago
lang-support.md Rewrite and refactor all documentation (#5534) 2 years ago
languages.md Adds support for multiple language servers per language. 2 years ago
remapping.md Rewrite and refactor all documentation (#5534) 2 years ago
themes.md feat(debug): highlight current line (#5957) 2 years ago
title-page.md book: add wiki links to the title page and install page (#3017) 2 years ago
usage.md Rewrite and refactor all documentation (#5534) 2 years ago