From 21bc4f13b8749c5a617edb9a351b1674a4e8f228 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 14 Feb 2026 01:51:10 +0200 Subject: [PATCH] Fix exotic fold range kinds (#49151) Follow-up of https://github.com/zed-industries/zed/pull/48611 Despite Zed not declaring such support in its capabilities, https://github.com/zed-industries/zed/blob/a0eb63d1affb6e7b7991e477c7e05824d0250255/crates/lsp/src/lsp.rs#L1010-L1016 `json-language-server` returns `object` as a folding range kind: bad The spec, even 3.18, does not really seem to allow it explicitly: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#foldingRangeKind but mentions that the real type > The type is a string since the value set is extensible The PR adds a capture enum variant for such cases, to get the folds in instead of failing on deserialization. See also: https://github.com/zed-industries/lsp-types/pull/10 Release Notes: - Fixed `json-language-server` document folds not being parsed correctly --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2c546a597b96bdd80e1ae41aacda1a70a27ee8b..e0fb29a92616fd5404716ce4c3a8a85bc3d6b77e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9720,7 +9720,7 @@ dependencies = [ [[package]] name = "lsp-types" version = "0.95.1" -source = "git+https://github.com/zed-industries/lsp-types?rev=fb6bcad59522455a041b7eb9579f706e5cfb2d6f#fb6bcad59522455a041b7eb9579f706e5cfb2d6f" +source = "git+https://github.com/zed-industries/lsp-types?rev=a4f410987660bf560d1e617cb78117c6b6b9f599#a4f410987660bf560d1e617cb78117c6b6b9f599" dependencies = [ "bitflags 1.3.2", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3df9b505a0032ea0aafd7cdb9eca7d0707d5289a..b7693d5a2668bdb97b7863b3010fdbd002e5b323 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -559,7 +559,7 @@ libc = "0.2" libsqlite3-sys = { version = "0.30.1", features = ["bundled"] } linkify = "0.10.0" log = { version = "0.4.16", features = ["kv_unstable_serde", "serde"] } -lsp-types = { git = "https://github.com/zed-industries/lsp-types", rev = "fb6bcad59522455a041b7eb9579f706e5cfb2d6f" } +lsp-types = { git = "https://github.com/zed-industries/lsp-types", rev = "a4f410987660bf560d1e617cb78117c6b6b9f599" } mach2 = "0.5" markup5ever_rcdom = "0.3.0" metal = "0.29"