From ddc469ca3ef5ed30757278c527cfc3368ba7dbe1 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 31 Dec 2024 01:34:25 +0200 Subject: [PATCH] Ensure zls is used for Zig as a primary language server (#22511) Part of https://github.com/zed-industries/zed/issues/22415 I've noticed that I cannot work with any Zig projects, as there were no "go to definition", formatting and inlay hints. After debugging, I've discovered that `typos` was registered as a first language server, becoming the "primary" one for Zig. That one does not have any proper capabilities, hence all corresponding LSP requests were no-op. While this solution is not ideal (I wonder, how many other set-ups are broken due to the same thing?), we'd better fix things for now this way at least. Release Notes: - Fixed `zls` not working properly when `typos` extension is installed --- assets/settings/default.json | 3 +++ crates/lsp/src/lsp.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/assets/settings/default.json b/assets/settings/default.json index 9f4f2dc34c0d9..9dbfc08e8d9d7 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -1103,6 +1103,9 @@ "prettier": { "allowed": true } + }, + "Zig": { + "language_servers": ["zls", "..."] } }, // Different settings for specific language models. diff --git a/crates/lsp/src/lsp.rs b/crates/lsp/src/lsp.rs index 473a7ac64eb34..25b6167c7472a 100644 --- a/crates/lsp/src/lsp.rs +++ b/crates/lsp/src/lsp.rs @@ -284,6 +284,7 @@ impl LspRequestFuture for LspRequest { } /// Combined capabilities of the server and the adapter. +#[derive(Debug)] pub struct AdapterServerCapabilities { // Reported capabilities by the server pub server_capabilities: ServerCapabilities,