1use std::option::Option;
2
3/// An LSP completion.
4#[derive(Debug, Clone)]
5pub struct Completion {
6 pub label: String,
7 pub label_details: Option<CompletionLabelDetails>,
8 pub detail: Option<String>,
9 pub kind: Option<CompletionKind>,
10 pub insert_text_format: Option<InsertTextFormat>,
11}
12
13/// The kind of an LSP completion.
14#[derive(Debug, Clone, Copy)]
15pub enum CompletionKind {
16 Text,
17 Method,
18 Function,
19 Constructor,
20 Field,
21 Variable,
22 Class,
23 Interface,
24 Module,
25 Property,
26 Unit,
27 Value,
28 Enum,
29 Keyword,
30 Snippet,
31 Color,
32 File,
33 Reference,
34 Folder,
35 EnumMember,
36 Constant,
37 Struct,
38 Event,
39 Operator,
40 TypeParameter,
41 Other(i32),
42}
43
44/// Label details for an LSP completion.
45#[derive(Debug, Clone)]
46pub struct CompletionLabelDetails {
47 pub detail: Option<String>,
48 pub description: Option<String>,
49}
50
51/// Defines how to interpret the insert text in a completion item.
52#[derive(Debug, Clone, Copy)]
53pub enum InsertTextFormat {
54 PlainText,
55 Snippet,
56 Other(i32),
57}
58
59/// An LSP symbol.
60#[derive(Debug, Clone)]
61pub struct Symbol {
62 pub kind: SymbolKind,
63 pub name: String,
64}
65
66/// The kind of an LSP symbol.
67#[derive(Debug, Clone, Copy)]
68pub enum SymbolKind {
69 File,
70 Module,
71 Namespace,
72 Package,
73 Class,
74 Method,
75 Property,
76 Field,
77 Constructor,
78 Enum,
79 Interface,
80 Function,
81 Variable,
82 Constant,
83 String,
84 Number,
85 Boolean,
86 Array,
87 Object,
88 Key,
89 Null,
90 EnumMember,
91 Struct,
92 Event,
93 Operator,
94 TypeParameter,
95 Other(i32),
96}