Common/LanguageFeature/DTO/HoverResultDTO.rs
1//! # HoverResultDTO
2//!
3//! Defines the Data Transfer Object for the result of a hover provider request.
4
5use serde::{Deserialize, Serialize};
6
7use super::{IMarkdownStringDTO::IMarkdownStringDTO, RangeDTO::RangeDTO};
8
9/// A serializable struct that represents the content to be displayed in a
10/// hover tooltip, analogous to `vscode.Hover`.
11#[derive(Serialize, Deserialize, Debug, Clone)]
12#[serde(rename_all = "PascalCase")]
13pub struct HoverResultDTO {
14 /// The contents of the hover, which can be one or more markdown strings.
15 pub Contents:Vec<IMarkdownStringDTO>,
16
17 /// An optional range to which this hover applies. When not specified, the
18 /// range of the word at the request position is used.
19 #[serde(skip_serializing_if = "Option::is_none")]
20 pub Range:Option<RangeDTO>,
21}