| 1 |
use serde::{Deserialize, Serialize}; |
| 2 |
|
| 3 |
use crate::{ |
| 4 |
DynamicRegistrationClientCapabilities, PartialResultParams, TextDocumentPositionParams, |
| 5 |
TextDocumentRegistrationOptions, WorkDoneProgressOptions, WorkDoneProgressParams, |
| 6 |
}; |
| 7 |
|
| 8 |
pub type MonikerClientCapabilities = DynamicRegistrationClientCapabilities; |
| 9 |
|
| 10 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 11 |
#[serde(untagged)] |
| 12 |
pub enum MonikerServerCapabilities { |
| 13 |
Options(MonikerOptions), |
| 14 |
RegistrationOptions(MonikerRegistrationOptions), |
| 15 |
} |
| 16 |
|
| 17 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 18 |
pub struct MonikerOptions { |
| 19 |
#[serde(flatten)] |
| 20 |
pub work_done_progress_options: WorkDoneProgressOptions, |
| 21 |
} |
| 22 |
|
| 23 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 24 |
#[serde(rename_all = "camelCase")] |
| 25 |
pub struct MonikerRegistrationOptions { |
| 26 |
#[serde(flatten)] |
| 27 |
pub text_document_registration_options: TextDocumentRegistrationOptions, |
| 28 |
|
| 29 |
#[serde(flatten)] |
| 30 |
pub moniker_options: MonikerOptions, |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
#[derive(Debug, Eq, PartialEq, Deserialize, Serialize, Copy, Clone)] |
| 35 |
#[serde(rename_all = "camelCase")] |
| 36 |
pub enum UniquenessLevel { |
| 37 |
|
| 38 |
Document, |
| 39 |
|
| 40 |
Project, |
| 41 |
|
| 42 |
Group, |
| 43 |
|
| 44 |
Scheme, |
| 45 |
|
| 46 |
Global, |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
#[derive(Debug, Eq, PartialEq, Deserialize, Serialize, Copy, Clone)] |
| 51 |
#[serde(rename_all = "camelCase")] |
| 52 |
pub enum MonikerKind { |
| 53 |
|
| 54 |
Import, |
| 55 |
|
| 56 |
Export, |
| 57 |
|
| 58 |
|
| 59 |
Local, |
| 60 |
} |
| 61 |
|
| 62 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 63 |
#[serde(rename_all = "camelCase")] |
| 64 |
pub struct MonikerParams { |
| 65 |
#[serde(flatten)] |
| 66 |
pub text_document_position_params: TextDocumentPositionParams, |
| 67 |
|
| 68 |
#[serde(flatten)] |
| 69 |
pub work_done_progress_params: WorkDoneProgressParams, |
| 70 |
|
| 71 |
#[serde(flatten)] |
| 72 |
pub partial_result_params: PartialResultParams, |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] |
| 77 |
#[serde(rename_all = "camelCase")] |
| 78 |
pub struct Moniker { |
| 79 |
|
| 80 |
pub scheme: String, |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
pub identifier: String, |
| 85 |
|
| 86 |
|
| 87 |
pub unique: UniquenessLevel, |
| 88 |
|
| 89 |
|
| 90 |
#[serde(skip_serializing_if = "Option::is_none")] |
| 91 |
pub kind: Option<MonikerKind>, |
| 92 |
} |