ZIm/crates/language/src
Marshall Bowers 3bd9a3f478
Respect the language_servers setting's order when determining the primary language server (#15624)
This PR updates how we determine the "primary" language server for a
buffer to make it respect the order specified by the `language_servers`
setting.

Previously we were relying on the language servers to be registered in
the right order in order to select the primary one effectively.

However, in my testing I observed some cases where a native language
server (e.g., `tailwindcss-language-server`) could end up first in the
list of language servers despite not being first in the
`language_servers` setting.

While this wasn't a problem for the Tailwind or ESLint language servers
on account of them being defined natively with the designation of
"secondary" language servers, this could cause problems with
extension-based language servers.

To remedy this, every time we start up language servers we reorder the
list of language servers for a given language to reflect the order in
the `language_servers` setting. This ordering then allows us to treat
the first language server in the list as the "primary" one.

Related issues:

- https://github.com/zed-industries/zed/issues/15023
- https://github.com/zed-industries/zed/issues/15279

Release Notes:

- The ordering of language servers will now respect the order in the
`language_servers` setting.
- The first language server in this list will be used as the primary
language server.
2024-08-01 11:58:23 -04:00
..
syntax_map Bump tree-sitter and related core language parser libraries (#14986) 2024-07-24 23:38:21 +03:00
buffer.rs chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
buffer_tests.rs chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
diagnostic_set.rs lsp: Pass back diagnostic .data when querying code actions for it (#14962) 2024-07-22 17:49:11 +02:00
highlight_map.rs Docs for indent_size_for_line and co 2024-01-09 20:50:34 +01:00
language.rs chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
language_registry.rs Respect the language_servers setting's order when determining the primary language server (#15624) 2024-08-01 11:58:23 -04:00
language_settings.rs Fix more instances of JSON schema getting clobbered when attaching references (#15339) 2024-07-27 11:44:40 -04:00
markdown.rs Fix Markdown code rendering in tooltips ignoring languages (#10607) 2024-04-16 12:49:35 +02:00
outline.rs Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00
proto.rs lsp: Pass back diagnostic .data when querying code actions for it (#14962) 2024-07-22 17:49:11 +02:00
syntax_map.rs chore: Fix clippy violations from Cargo.toml (#15216) 2024-07-25 20:22:01 +02:00
task_context.rs tasks: Add experimental support for user-defined task variables (#13699) 2024-07-01 15:59:19 +02:00