aboutsummaryrefslogtreecommitdiff
path: root/book
diff options
context:
space:
mode:
authorPhilipp Mildenberger2023-03-18 21:53:09 +0000
committerPhilipp Mildenberger2023-05-18 19:48:32 +0000
commitd9630506218f713cbacfa198443c85e9881b8a8b (patch)
tree478a4e93c8a6c41860d95f4c8665bfa77c1d22ea /book
parent9639f42766a18983dc2298e60bf47a748845bde7 (diff)
Format/fix language docs a bit
Diffstat (limited to 'book')
-rw-r--r--book/src/languages.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/book/src/languages.md b/book/src/languages.md
index 3328c610..3f244566 100644
--- a/book/src/languages.md
+++ b/book/src/languages.md
@@ -140,10 +140,14 @@ config = { format = { "semicolons" = "insert", "insertSpaceBeforeFunctionParenth
### Configuring Language Servers for a language
The `language-servers` attribute in a language tells helix which language servers are used for this language.
+
They have to be defined in the `[language-server]` table as described in the previous section.
+
Different languages can use the same language server instance, e.g. `typescript-language-server` is used for javascript, jsx, tsx and typescript by default.
+
In case multiple language servers are specified in the `language-servers` attribute of a `language`,
it's often useful to only enable/disable certain language-server features for these language servers.
+
For example `efm-lsp-prettier` of the previous example is used only with a formatting command `prettier`,
so everything else should be handled by the `typescript-language-server` (which is configured by default)
The language configuration for typescript could look like this:
@@ -162,12 +166,12 @@ 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.
+Each requested LSP feature is prioritized 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.
If a language server itself doesn't support a feature the next language server array entry will be tried (and so on).
-The list of supported features are:
+The list of supported features is:
- `format`
- `goto-definition`