Skip to content

Commit fc9a89d

Browse files
committed
Fix non-lsp compliant Response definition
1 parent 8d75311 commit fc9a89d

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ ra-ap-rustc_pattern_analysis = { version = "0.123", default-features = false }
100100
# in-tree crates that are published separately and follow semver. See lib/README.md
101101
line-index = { version = "0.1.2" }
102102
la-arena = { version = "0.3.1" }
103-
lsp-server = { version = "0.7.8" }
103+
lsp-server = { version = "0.7.9" }
104104

105105
# non-local crates
106106
anyhow = "1.0.98"
@@ -125,11 +125,11 @@ memmap2 = "0.9.5"
125125
nohash-hasher = "0.2.0"
126126
oorandom = "11.1.5"
127127
object = { version = "0.36.7", default-features = false, features = [
128-
"std",
129-
"read_core",
130-
"elf",
131-
"macho",
132-
"pe",
128+
"std",
129+
"read_core",
130+
"elf",
131+
"macho",
132+
"pe",
133133
] }
134134
process-wrap = { version = "8.2.1", features = ["std"] }
135135
pulldown-cmark-to-cmark = "10.0.4"
@@ -139,9 +139,9 @@ rowan = "=0.15.15"
139139
# Ideally we'd not enable the macros feature but unfortunately the `tracked` attribute does not work
140140
# on impls without it
141141
salsa = { version = "0.23.0", default-features = true, features = [
142-
"rayon",
143-
"salsa_unstable",
144-
"macros",
142+
"rayon",
143+
"salsa_unstable",
144+
"macros",
145145
] }
146146
salsa-macros = "0.23.0"
147147
semver = "1.0.26"
@@ -151,22 +151,22 @@ serde_json = "1.0.140"
151151
rustc-hash = "2.1.1"
152152
rustc-literal-escaper = "0.0.4"
153153
smallvec = { version = "1.15.1", features = [
154-
"const_new",
155-
"union",
156-
"const_generics",
154+
"const_new",
155+
"union",
156+
"const_generics",
157157
] }
158158
smol_str = "0.3.2"
159159
temp-dir = "0.1.16"
160160
text-size = "1.1.1"
161161
tracing = "0.1.41"
162162
tracing-tree = "0.4.0"
163163
tracing-subscriber = { version = "0.3.19", default-features = false, features = [
164-
"registry",
165-
"fmt",
166-
"local-time",
167-
"std",
168-
"time",
169-
"tracing-log",
164+
"registry",
165+
"fmt",
166+
"local-time",
167+
"std",
168+
"time",
169+
"tracing-log",
170170
] }
171171
triomphe = { version = "0.1.14", default-features = false, features = ["std"] }
172172
url = "2.5.4"
@@ -176,7 +176,7 @@ xshell = "0.2.7"
176176
dashmap = { version = "=6.1.0", features = ["raw-api", "inline"] }
177177
# We need to freeze the version of the crate, as it needs to match with dashmap
178178
hashbrown = { version = "0.14.*", features = [
179-
"inline-more",
179+
"inline-more",
180180
], default-features = false }
181181

182182
[workspace.lints.rust]

lib/lsp-server/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lsp-server"
3-
version = "0.7.8"
3+
version = "0.7.9"
44
description = "Generic LSP server scaffold."
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/rust-analyzer/tree/master/lib/lsp-server"
@@ -16,9 +16,9 @@ crossbeam-channel.workspace = true
1616
[dev-dependencies]
1717
lsp-types = "=0.95"
1818
ctrlc = "3.4.7"
19-
anyhow.workspace = true
19+
anyhow.workspace = true
2020
rustc-hash.workspace = true
21-
toolchain.workspace = true
21+
toolchain.workspace = true
2222

2323
[lints]
2424
workspace = true

lib/lsp-server/src/msg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ pub struct Response {
8484
// request id. We fail deserialization in that case, so we just
8585
// make this field mandatory.
8686
pub id: RequestId,
87-
#[serde(skip_serializing_if = "Option::is_none")]
87+
#[serde(skip_serializing_if = "Option::is_none", default)]
8888
pub result: Option<serde_json::Value>,
89-
#[serde(skip_serializing_if = "Option::is_none")]
89+
#[serde(skip_serializing_if = "Option::is_none", default)]
9090
pub error: Option<ResponseError>,
9191
}
9292

9393
#[derive(Debug, Serialize, Deserialize, Clone)]
9494
pub struct ResponseError {
9595
pub code: i32,
9696
pub message: String,
97-
#[serde(skip_serializing_if = "Option::is_none")]
97+
#[serde(skip_serializing_if = "Option::is_none", default)]
9898
pub data: Option<serde_json::Value>,
9999
}
100100

0 commit comments

Comments
 (0)