1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use lsp_msg_derive::lsp_kind;
use serde::{Deserialize, Serialize};
#[lsp_kind]
pub enum Elective<T> {
Absent,
Present(T),
}
impl<T> Elective<T> {
pub fn is_absent(&self) -> bool {
match self {
Elective::Absent => true,
Elective::Present(_) => false,
}
}
}
impl<T> Default for Elective<T> {
fn default() -> Self {
Elective::Absent
}
}
#[lsp_kind]
#[derive(Clone, Copy)]
pub enum MarkupKind {
Plaintext,
Markdown,
}