1use crate::{
2 PartialResultParams, Range, TextDocumentIdentifier, WorkDoneProgressOptions,
3 WorkDoneProgressParams,
4};
5use serde::{Deserialize, Serialize};
6use serde_json::Value;
7use url::Url;
89#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
10#[serde(rename_all = "camelCase")]
11pub struct DocumentLinkClientCapabilities {
12/// Whether document link supports dynamic registration.
13#[serde(skip_serializing_if = "Option::is_none")]
14pub dynamic_registration: Option<bool>,
1516/// Whether the client support the `tooltip` property on `DocumentLink`.
17#[serde(skip_serializing_if = "Option::is_none")]
18pub tooltip_support: Option<bool>,
19}
2021#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
22#[serde(rename_all = "camelCase")]
23pub struct DocumentLinkOptions {
24/// Document links have a resolve provider as well.
25#[serde(skip_serializing_if = "Option::is_none")]
26pub resolve_provider: Option<bool>,
2728#[serde(flatten)]
29pub work_done_progress_options: WorkDoneProgressOptions,
30}
3132#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
33#[serde(rename_all = "camelCase")]
34pub struct DocumentLinkParams {
35/// The document to provide document links for.
36pub text_document: TextDocumentIdentifier,
3738#[serde(flatten)]
39pub work_done_progress_params: WorkDoneProgressParams,
4041#[serde(flatten)]
42pub partial_result_params: PartialResultParams,
43}
4445/// A document link is a range in a text document that links to an internal or external resource, like another
46/// text document or a web site.
47#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
48pub struct DocumentLink {
49/// The range this link applies to.
50pub range: Range,
51/// The uri this link points to.
52#[serde(skip_serializing_if = "Option::is_none")]
53pub target: Option<Url>,
5455/// The tooltip text when you hover over this link.
56 ///
57 /// If a tooltip is provided, is will be displayed in a string that includes instructions on how to
58 /// trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
59 /// user settings, and localization.
60#[serde(skip_serializing_if = "Option::is_none")]
61pub tooltip: Option<String>,
6263/// A data entry field that is preserved on a document link between a DocumentLinkRequest
64 /// and a DocumentLinkResolveRequest.
65#[serde(skip_serializing_if = "Option::is_none")]
66pub data: Option<Value>,
67}