diff options
Diffstat (limited to 'crates/rust-analyzer/src/lsp_ext.rs')
-rw-r--r-- | crates/rust-analyzer/src/lsp_ext.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/crates/rust-analyzer/src/lsp_ext.rs b/crates/rust-analyzer/src/lsp_ext.rs index 145a389ce..75ea48892 100644 --- a/crates/rust-analyzer/src/lsp_ext.rs +++ b/crates/rust-analyzer/src/lsp_ext.rs | |||
@@ -271,26 +271,24 @@ impl Request for HoverRequest { | |||
271 | 271 | ||
272 | #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] | 272 | #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] |
273 | pub struct Hover { | 273 | pub struct Hover { |
274 | pub contents: lsp_types::HoverContents, | 274 | #[serde(flatten)] |
275 | #[serde(skip_serializing_if = "Option::is_none")] | 275 | pub hover: lsp_types::Hover, |
276 | pub range: Option<Range>, | ||
277 | #[serde(skip_serializing_if = "Option::is_none")] | 276 | #[serde(skip_serializing_if = "Option::is_none")] |
278 | pub actions: Option<Vec<CommandLinkGroup>>, | 277 | pub actions: Option<Vec<CommandLinkGroup>>, |
279 | } | 278 | } |
280 | 279 | ||
281 | #[derive(Debug, PartialEq, Eq, Clone, Default, Deserialize, Serialize)] | 280 | #[derive(Debug, PartialEq, Clone, Default, Deserialize, Serialize)] |
282 | pub struct CommandLinkGroup { | 281 | pub struct CommandLinkGroup { |
282 | #[serde(skip_serializing_if = "Option::is_none")] | ||
283 | pub title: Option<String>, | 283 | pub title: Option<String>, |
284 | pub commands: Vec<CommandLink>, | 284 | pub commands: Vec<CommandLink>, |
285 | } | 285 | } |
286 | 286 | ||
287 | // LSP v3.15 Command does not have a `tooltip` field, vscode supports one. | 287 | // LSP v3.15 Command does not have a `tooltip` field, vscode supports one. |
288 | #[derive(Debug, PartialEq, Eq, Clone, Default, Deserialize, Serialize)] | 288 | #[derive(Debug, PartialEq, Clone, Default, Deserialize, Serialize)] |
289 | pub struct CommandLink { | 289 | pub struct CommandLink { |
290 | pub title: String, | 290 | #[serde(flatten)] |
291 | pub command: String, | 291 | pub command: lsp_types::Command, |
292 | #[serde(skip_serializing_if = "Option::is_none")] | 292 | #[serde(skip_serializing_if = "Option::is_none")] |
293 | pub tooltip: Option<String>, | 293 | pub tooltip: Option<String>, |
294 | #[serde(skip_serializing_if = "Option::is_none")] | ||
295 | pub arguments: Option<Vec<serde_json::Value>>, | ||
296 | } | 294 | } |