lsp.rs

 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    pub container_name: Option<String>,
65}
66
67/// The kind of an LSP symbol.
68#[derive(Debug, Clone, Copy)]
69pub enum SymbolKind {
70    File,
71    Module,
72    Namespace,
73    Package,
74    Class,
75    Method,
76    Property,
77    Field,
78    Constructor,
79    Enum,
80    Interface,
81    Function,
82    Variable,
83    Constant,
84    String,
85    Number,
86    Boolean,
87    Array,
88    Object,
89    Key,
90    Null,
91    EnumMember,
92    Struct,
93    Event,
94    Operator,
95    TypeParameter,
96    Other(i32),
97}