lsp_types/
document_highlight.rs
1use serde::{Deserialize, Serialize};
2
3use crate::{
4 DynamicRegistrationClientCapabilities, PartialResultParams, Range, TextDocumentPositionParams,
5 WorkDoneProgressParams,
6};
7
8pub type DocumentHighlightClientCapabilities = DynamicRegistrationClientCapabilities;
9
10#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
11#[serde(rename_all = "camelCase")]
12pub struct DocumentHighlightParams {
13 #[serde(flatten)]
14 pub text_document_position_params: TextDocumentPositionParams,
15
16 #[serde(flatten)]
17 pub work_done_progress_params: WorkDoneProgressParams,
18
19 #[serde(flatten)]
20 pub partial_result_params: PartialResultParams,
21}
22
23#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
27pub struct DocumentHighlight {
28 pub range: Range,
30
31 #[serde(skip_serializing_if = "Option::is_none")]
33 pub kind: Option<DocumentHighlightKind>,
34}
35
36#[derive(Eq, PartialEq, Copy, Clone, Deserialize, Serialize)]
38#[serde(transparent)]
39pub struct DocumentHighlightKind(i32);
40lsp_enum! {
41impl DocumentHighlightKind {
42 pub const TEXT: DocumentHighlightKind = DocumentHighlightKind(1);
44
45 pub const READ: DocumentHighlightKind = DocumentHighlightKind(2);
47
48 pub const WRITE: DocumentHighlightKind = DocumentHighlightKind(3);
50}
51}