| 1 |
use crate::{Range, TextDocumentPositionParams, WorkDoneProgressOptions, WorkDoneProgressParams}; |
| 2 |
use serde::{Deserialize, Serialize}; |
| 3 |
|
| 4 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 5 |
#[serde(rename_all = "camelCase")] |
| 6 |
pub struct RenameParams { |
| 7 |
|
| 8 |
#[serde(flatten)] |
| 9 |
pub text_document_position: TextDocumentPositionParams, |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
pub new_name: String, |
| 15 |
|
| 16 |
#[serde(flatten)] |
| 17 |
pub work_done_progress_params: WorkDoneProgressParams, |
| 18 |
} |
| 19 |
|
| 20 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 21 |
#[serde(rename_all = "camelCase")] |
| 22 |
pub struct RenameOptions { |
| 23 |
|
| 24 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 25 |
pub prepare_provider: Option<bool>, |
| 26 |
|
| 27 |
#[serde(flatten)] |
| 28 |
pub work_done_progress_options: WorkDoneProgressOptions, |
| 29 |
} |
| 30 |
|
| 31 |
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)] |
| 32 |
#[serde(rename_all = "camelCase")] |
| 33 |
pub struct RenameClientCapabilities { |
| 34 |
|
| 35 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 36 |
pub dynamic_registration: Option<bool>, |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 42 |
pub prepare_support: Option<bool>, |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 51 |
pub prepare_support_default_behavior: Option<PrepareSupportDefaultBehavior>, |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 61 |
pub honors_change_annotations: Option<bool>, |
| 62 |
} |
| 63 |
|
| 64 |
#[derive(Eq, PartialEq, Copy, Clone, Serialize, Deserialize)] |
| 65 |
#[serde(transparent)] |
| 66 |
pub struct PrepareSupportDefaultBehavior(i32); |
| 67 |
lsp_enum! { |
| 68 |
impl PrepareSupportDefaultBehavior { |
| 69 |
|
| 70 |
|
| 71 |
pub const IDENTIFIER: PrepareSupportDefaultBehavior = PrepareSupportDefaultBehavior(1); |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 76 |
#[serde(untagged)] |
| 77 |
#[serde(rename_all = "camelCase")] |
| 78 |
pub enum PrepareRenameResponse { |
| 79 |
Range(Range), |
| 80 |
RangeWithPlaceholder { |
| 81 |
range: Range, |
| 82 |
placeholder: String, |
| 83 |
}, |
| 84 |
#[serde(rename_all = "camelCase")] |
| 85 |
DefaultBehavior { |
| 86 |
default_behavior: bool, |
| 87 |
}, |
| 88 |
} |