Skip to content

Commit 43b44cf

Browse files
authored
Merge pull request #18836 from Veykril/push-kksuoxxptvty
fix: Be more permissive with completion resolve data
2 parents 68c2241 + 0389235 commit 43b44cf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/ext.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
//! rust-analyzer extensions to the LSP.
22
3+
// Note when adding new resolve payloads, add a #[serde(default)] on boolean fields as some clients
4+
// might strip `false` values from the JSON payload due to their reserialization logic turning false
5+
// into null which will then cause them to be omitted in the resolve request. See https://github.com/rust-lang/rust-analyzer/issues/18767
6+
37
#![allow(clippy::disallowed_types)]
48

59
use std::ops;
@@ -829,6 +833,7 @@ pub struct CompletionResolveData {
829833
pub version: Option<i32>,
830834
#[serde(skip_serializing_if = "Option::is_none", default)]
831835
pub trigger_character: Option<char>,
836+
#[serde(default)]
832837
pub for_ref: bool,
833838
pub hash: String,
834839
}

src/tools/rust-analyzer/docs/dev/lsp-extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!---
2-
lsp/ext.rs hash: 512c06cd8b46a21d
2+
lsp/ext.rs hash: 6dd762ae19630ec0
33
44
If you need to change the above hash to make the test pass, please check if you
55
need to adjust this doc as well and ping this issue:

0 commit comments

Comments
 (0)