Skip to content

Commit

Permalink
Merge pull request #18836 from Veykril/push-kksuoxxptvty
Browse files Browse the repository at this point in the history
fix: Be more permissive with completion resolve data
  • Loading branch information
Veykril authored Jan 6, 2025
2 parents c89c03f + 8a9cacb commit 47ee513
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions crates/rust-analyzer/src/lsp/ext.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! rust-analyzer extensions to the LSP.
// Note when adding new resolve payloads, add a #[serde(default)] on boolean fields as some clients
// might strip `false` values from the JSON payload due to their reserialization logic turning false
// into null which will then cause them to be omitted in the resolve request. See https://github.com/rust-lang/rust-analyzer/issues/18767

#![allow(clippy::disallowed_types)]

use std::ops;
Expand Down Expand Up @@ -829,6 +833,7 @@ pub struct CompletionResolveData {
pub version: Option<i32>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub trigger_character: Option<char>,
#[serde(default)]
pub for_ref: bool,
pub hash: String,
}
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/lsp-extensions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
lsp/ext.rs hash: 512c06cd8b46a21d
lsp/ext.rs hash: 6dd762ae19630ec0
If you need to change the above hash to make the test pass, please check if you
need to adjust this doc as well and ping this issue:
Expand Down

0 comments on commit 47ee513

Please sign in to comment.