| 1 |
use serde::{Deserialize, Serialize}; |
| 2 |
|
| 3 |
use crate::{ |
| 4 |
DynamicRegistrationClientCapabilities, PartialResultParams, Range, TextDocumentPositionParams, |
| 5 |
WorkDoneProgressParams, |
| 6 |
}; |
| 7 |
|
| 8 |
pub type DocumentHighlightClientCapabilities = DynamicRegistrationClientCapabilities; |
| 9 |
|
| 10 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 11 |
#[serde(rename_all = "camelCase")] |
| 12 |
pub 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 |
|
| 24 |
|
| 25 |
|
| 26 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 27 |
pub struct DocumentHighlight { |
| 28 |
|
| 29 |
pub range: Range, |
| 30 |
|
| 31 |
|
| 32 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 33 |
pub kind: Option<DocumentHighlightKind>, |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
#[derive(Eq, PartialEq, Copy, Clone, Deserialize, Serialize)] |
| 38 |
#[serde(transparent)] |
| 39 |
pub struct DocumentHighlightKind(i32); |
| 40 |
lsp_enum! { |
| 41 |
impl DocumentHighlightKind { |
| 42 |
|
| 43 |
pub const TEXT: DocumentHighlightKind = DocumentHighlightKind(1); |
| 44 |
|
| 45 |
|
| 46 |
pub const READ: DocumentHighlightKind = DocumentHighlightKind(2); |
| 47 |
|
| 48 |
|
| 49 |
pub const WRITE: DocumentHighlightKind = DocumentHighlightKind(3); |
| 50 |
} |
| 51 |
} |