From 6256b007489f1e2db3c40c88911d4ff310844350 Mon Sep 17 00:00:00 2001
From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com>
Date: Sat, 14 Feb 2026 00:04:35 +0000
Subject: [PATCH] Fix exotic fold range kinds (#49151) (cherry-pick to preview)
(#49152)
Cherry-pick of #49151 to preview
----
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:
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
Co-authored-by: Kirill Bulatov
---
Cargo.lock | 2 +-
Cargo.toml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index c821915869d18a83802ecf7e139715339ab1e27d..dad6c656e0728dab2ec2bce60d3b3ad2415bfbee 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -9745,7 +9745,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 b5397ddf73470a28edfe8ec7867701345ee4449d..2c964a16811a289f57c10647d43947ba6d776645 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"