doc: Improve documentation for language server ... expansion (#50672)

Hi! The `...` entry in the `language_servers` setting was only explained
in a single bullet point, which led users to misconfigure their setup,
particularly when overriding defaults that disable certain servers with
`!`.

Add a detailed explanation of how `...` works and a table of examples
using Ruby's real server configuration to illustrate the override
behavior.

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
This commit is contained in:
Vitaly Slobodin 2026-03-04 08:32:12 +01:00 committed by GitHub
parent cdb34c30c9
commit e51cd4931c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,11 +122,40 @@ You can specify your preference using the `language_servers` setting:
In this example:
- `intelephense` is set as the primary language server
- `phpactor` is disabled (note the `!` prefix)
- `...` expands to the rest of the language servers that are registered for PHP
- `intelephense` is set as the primary language server.
- `phpactor` and `phptools` are disabled (note the `!` prefix).
- `"..."` expands to the rest of the language servers registered for PHP that are not already listed.
This configuration allows you to tailor the language server setup to your specific needs, ensuring that you get the most suitable functionality for your development workflow.
The `"..."` entry acts as a wildcard that includes any registered language server you haven't explicitly mentioned. Servers you list by name keep their position, and `"..."` fills in the remaining ones at that point in the list. Servers prefixed with `!` are excluded entirely. This means that if a new language server extension is installed or a new server is registered for a language, `"..."` will automatically include it. If you want full control over which servers are enabled, omit `"..."` — only the servers you list by name will be used.
#### Examples
Suppose you're working with Ruby. The default configuration is:
```json [settings]
{
"language_servers": [
"solargraph",
"!ruby-lsp",
"!rubocop",
"!sorbet",
"!steep",
"!kanayago",
"..."
]
}
```
When you override `language_servers` in your settings, your list **replaces** the default entirely. This means default-disabled servers like `kanayago` will be re-enabled by `"..."` unless you explicitly disable them again.
| Configuration | Result |
| ------------------------------------------------- | ------------------------------------------------------------------ |
| `["..."]` | `solargraph`, `ruby-lsp`, `rubocop`, `sorbet`, `steep`, `kanayago` |
| `["ruby-lsp", "..."]` | `ruby-lsp`, `solargraph`, `rubocop`, `sorbet`, `steep`, `kanayago` |
| `["ruby-lsp", "!solargraph", "!kanayago", "..."]` | `ruby-lsp`, `rubocop`, `sorbet`, `steep` |
| `["ruby-lsp", "solargraph"]` | `ruby-lsp`, `solargraph` |
> Note: In the first example, `"..."` includes `kanayago` even though it is disabled by default. The override replaced the default list, so the `"!kanayago"` entry is no longer present. To keep it disabled, you must include `"!kanayago"` in your configuration.
### Toolchains