File tree Expand file tree Collapse file tree 3 files changed +66
-1
lines changed Expand file tree Collapse file tree 3 files changed +66
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ console_log = "0.1"
13
13
log = " 0.4"
14
14
wasm-bindgen = " 0.2.50"
15
15
serde = { version = " 1.0" , features = [" derive" ] }
16
+ serde_repr = " 0.1"
16
17
serde-wasm-bindgen = " 0.1"
17
18
18
19
ra_ide_api = { git = " https://github.com/rust-analyzer/rust-analyzer" , features = [" wasm" ] }
Original file line number Diff line number Diff line change 1
1
use serde:: { Deserialize , Serialize } ;
2
+ use serde_repr:: Serialize_repr ;
2
3
3
4
#[ derive( Serialize ) ]
4
5
pub struct Hover {
@@ -70,7 +71,58 @@ pub struct RenameLocation {
70
71
pub struct CompletionItem {
71
72
pub label : String ,
72
73
pub range : Range ,
73
- pub kind : u32 ,
74
+ pub kind : CompletionItemKind ,
74
75
pub detail : Option < String > ,
75
76
pub insertText : String ,
77
+ pub insertTextRules : CompletionItemInsertTextRule ,
78
+ pub documentation : Option < MarkdownString > ,
79
+ pub filterText : String ,
80
+ }
81
+
82
+ #[ allow( dead_code) ]
83
+ #[ derive( Serialize_repr ) ]
84
+ #[ repr( u8 ) ]
85
+ pub enum CompletionItemKind {
86
+ Method = 0 ,
87
+ Function = 1 ,
88
+ Constructor = 2 ,
89
+ Field = 3 ,
90
+ Variable = 4 ,
91
+ Class = 5 ,
92
+ Struct = 6 ,
93
+ Interface = 7 ,
94
+ Module = 8 ,
95
+ Property = 9 ,
96
+ Event = 10 ,
97
+ Operator = 11 ,
98
+ Unit = 12 ,
99
+ Value = 13 ,
100
+ Constant = 14 ,
101
+ Enum = 15 ,
102
+ EnumMember = 16 ,
103
+ Keyword = 17 ,
104
+ Text = 18 ,
105
+ Color = 19 ,
106
+ File = 20 ,
107
+ Reference = 21 ,
108
+ Customcolor = 22 ,
109
+ Folder = 23 ,
110
+ TypeParameter = 24 ,
111
+ Snippet = 25
112
+ }
113
+
114
+ #[ allow( dead_code) ]
115
+ #[ derive( Serialize_repr ) ]
116
+ #[ repr( u8 ) ]
117
+ pub enum CompletionItemInsertTextRule {
118
+ None = 0 ,
119
+ /**
120
+ * Adjust whitespace/indentation of multiline insert texts to
121
+ * match the current line indentation.
122
+ */
123
+ KeepWhitespace = 1 ,
124
+ /**
125
+ * `insertText` is a snippet.
126
+ */
127
+ InsertAsSnippet = 4 ,
76
128
}
You can’t perform that action at this time.
0 commit comments