@@ -45,48 +45,48 @@ pub(crate) fn range(line_index: &LineIndex, range: TextRange) -> lsp_types::Rang
45
45
46
46
pub ( crate ) fn symbol_kind ( symbol_kind : SymbolKind ) -> lsp_types:: SymbolKind {
47
47
match symbol_kind {
48
- SymbolKind :: Function => lsp_types:: SymbolKind :: Function ,
49
- SymbolKind :: Struct => lsp_types:: SymbolKind :: Struct ,
50
- SymbolKind :: Enum => lsp_types:: SymbolKind :: Enum ,
51
- SymbolKind :: Variant => lsp_types:: SymbolKind :: EnumMember ,
52
- SymbolKind :: Trait => lsp_types:: SymbolKind :: Interface ,
53
- SymbolKind :: Macro => lsp_types:: SymbolKind :: Function ,
54
- SymbolKind :: Module => lsp_types:: SymbolKind :: Module ,
55
- SymbolKind :: TypeAlias | SymbolKind :: TypeParam => lsp_types:: SymbolKind :: TypeParameter ,
56
- SymbolKind :: Field => lsp_types:: SymbolKind :: Field ,
57
- SymbolKind :: Static => lsp_types:: SymbolKind :: Constant ,
58
- SymbolKind :: Const => lsp_types:: SymbolKind :: Constant ,
59
- SymbolKind :: ConstParam => lsp_types:: SymbolKind :: Constant ,
60
- SymbolKind :: Impl => lsp_types:: SymbolKind :: Object ,
48
+ SymbolKind :: Function => lsp_types:: SymbolKind :: FUNCTION ,
49
+ SymbolKind :: Struct => lsp_types:: SymbolKind :: STRUCT ,
50
+ SymbolKind :: Enum => lsp_types:: SymbolKind :: ENUM ,
51
+ SymbolKind :: Variant => lsp_types:: SymbolKind :: ENUM_MEMBER ,
52
+ SymbolKind :: Trait => lsp_types:: SymbolKind :: INTERFACE ,
53
+ SymbolKind :: Macro => lsp_types:: SymbolKind :: FUNCTION ,
54
+ SymbolKind :: Module => lsp_types:: SymbolKind :: MODULE ,
55
+ SymbolKind :: TypeAlias | SymbolKind :: TypeParam => lsp_types:: SymbolKind :: TYPE_PARAMETER ,
56
+ SymbolKind :: Field => lsp_types:: SymbolKind :: FIELD ,
57
+ SymbolKind :: Static => lsp_types:: SymbolKind :: CONSTANT ,
58
+ SymbolKind :: Const => lsp_types:: SymbolKind :: CONSTANT ,
59
+ SymbolKind :: ConstParam => lsp_types:: SymbolKind :: CONSTANT ,
60
+ SymbolKind :: Impl => lsp_types:: SymbolKind :: OBJECT ,
61
61
SymbolKind :: Local
62
62
| SymbolKind :: SelfParam
63
63
| SymbolKind :: LifetimeParam
64
64
| SymbolKind :: ValueParam
65
- | SymbolKind :: Label => lsp_types:: SymbolKind :: Variable ,
66
- SymbolKind :: Union => lsp_types:: SymbolKind :: Struct ,
65
+ | SymbolKind :: Label => lsp_types:: SymbolKind :: VARIABLE ,
66
+ SymbolKind :: Union => lsp_types:: SymbolKind :: STRUCT ,
67
67
}
68
68
}
69
69
70
70
pub ( crate ) fn structure_node_kind ( kind : StructureNodeKind ) -> lsp_types:: SymbolKind {
71
71
match kind {
72
72
StructureNodeKind :: SymbolKind ( symbol) => symbol_kind ( symbol) ,
73
- StructureNodeKind :: Region => lsp_types:: SymbolKind :: Namespace ,
73
+ StructureNodeKind :: Region => lsp_types:: SymbolKind :: NAMESPACE ,
74
74
}
75
75
}
76
76
77
77
pub ( crate ) fn document_highlight_kind (
78
78
category : ReferenceCategory ,
79
79
) -> lsp_types:: DocumentHighlightKind {
80
80
match category {
81
- ReferenceCategory :: Read => lsp_types:: DocumentHighlightKind :: Read ,
82
- ReferenceCategory :: Write => lsp_types:: DocumentHighlightKind :: Write ,
81
+ ReferenceCategory :: Read => lsp_types:: DocumentHighlightKind :: READ ,
82
+ ReferenceCategory :: Write => lsp_types:: DocumentHighlightKind :: WRITE ,
83
83
}
84
84
}
85
85
86
86
pub ( crate ) fn diagnostic_severity ( severity : Severity ) -> lsp_types:: DiagnosticSeverity {
87
87
match severity {
88
- Severity :: Error => lsp_types:: DiagnosticSeverity :: Error ,
89
- Severity :: WeakWarning => lsp_types:: DiagnosticSeverity :: Hint ,
88
+ Severity :: Error => lsp_types:: DiagnosticSeverity :: ERROR ,
89
+ Severity :: WeakWarning => lsp_types:: DiagnosticSeverity :: HINT ,
90
90
}
91
91
}
92
92
@@ -100,34 +100,34 @@ pub(crate) fn completion_item_kind(
100
100
completion_item_kind : CompletionItemKind ,
101
101
) -> lsp_types:: CompletionItemKind {
102
102
match completion_item_kind {
103
- CompletionItemKind :: Attribute => lsp_types:: CompletionItemKind :: EnumMember ,
104
- CompletionItemKind :: Binding => lsp_types:: CompletionItemKind :: Variable ,
105
- CompletionItemKind :: BuiltinType => lsp_types:: CompletionItemKind :: Struct ,
106
- CompletionItemKind :: Keyword => lsp_types:: CompletionItemKind :: Keyword ,
107
- CompletionItemKind :: Method => lsp_types:: CompletionItemKind :: Method ,
108
- CompletionItemKind :: Snippet => lsp_types:: CompletionItemKind :: Snippet ,
109
- CompletionItemKind :: UnresolvedReference => lsp_types:: CompletionItemKind :: Reference ,
103
+ CompletionItemKind :: Attribute => lsp_types:: CompletionItemKind :: ENUM_MEMBER ,
104
+ CompletionItemKind :: Binding => lsp_types:: CompletionItemKind :: VARIABLE ,
105
+ CompletionItemKind :: BuiltinType => lsp_types:: CompletionItemKind :: STRUCT ,
106
+ CompletionItemKind :: Keyword => lsp_types:: CompletionItemKind :: KEYWORD ,
107
+ CompletionItemKind :: Method => lsp_types:: CompletionItemKind :: METHOD ,
108
+ CompletionItemKind :: Snippet => lsp_types:: CompletionItemKind :: SNIPPET ,
109
+ CompletionItemKind :: UnresolvedReference => lsp_types:: CompletionItemKind :: REFERENCE ,
110
110
CompletionItemKind :: SymbolKind ( symbol) => match symbol {
111
- SymbolKind :: Const => lsp_types:: CompletionItemKind :: Constant ,
112
- SymbolKind :: ConstParam => lsp_types:: CompletionItemKind :: TypeParameter ,
113
- SymbolKind :: Enum => lsp_types:: CompletionItemKind :: Enum ,
114
- SymbolKind :: Field => lsp_types:: CompletionItemKind :: Field ,
115
- SymbolKind :: Function => lsp_types:: CompletionItemKind :: Function ,
116
- SymbolKind :: Impl => lsp_types:: CompletionItemKind :: Text ,
117
- SymbolKind :: Label => lsp_types:: CompletionItemKind :: Variable ,
118
- SymbolKind :: LifetimeParam => lsp_types:: CompletionItemKind :: TypeParameter ,
119
- SymbolKind :: Local => lsp_types:: CompletionItemKind :: Variable ,
120
- SymbolKind :: Macro => lsp_types:: CompletionItemKind :: Method ,
121
- SymbolKind :: Module => lsp_types:: CompletionItemKind :: Module ,
122
- SymbolKind :: SelfParam => lsp_types:: CompletionItemKind :: Value ,
123
- SymbolKind :: Static => lsp_types:: CompletionItemKind :: Value ,
124
- SymbolKind :: Struct => lsp_types:: CompletionItemKind :: Struct ,
125
- SymbolKind :: Trait => lsp_types:: CompletionItemKind :: Interface ,
126
- SymbolKind :: TypeAlias => lsp_types:: CompletionItemKind :: Struct ,
127
- SymbolKind :: TypeParam => lsp_types:: CompletionItemKind :: TypeParameter ,
128
- SymbolKind :: Union => lsp_types:: CompletionItemKind :: Struct ,
129
- SymbolKind :: ValueParam => lsp_types:: CompletionItemKind :: Value ,
130
- SymbolKind :: Variant => lsp_types:: CompletionItemKind :: EnumMember ,
111
+ SymbolKind :: Const => lsp_types:: CompletionItemKind :: CONSTANT ,
112
+ SymbolKind :: ConstParam => lsp_types:: CompletionItemKind :: TYPE_PARAMETER ,
113
+ SymbolKind :: Enum => lsp_types:: CompletionItemKind :: ENUM ,
114
+ SymbolKind :: Field => lsp_types:: CompletionItemKind :: FIELD ,
115
+ SymbolKind :: Function => lsp_types:: CompletionItemKind :: FUNCTION ,
116
+ SymbolKind :: Impl => lsp_types:: CompletionItemKind :: TEXT ,
117
+ SymbolKind :: Label => lsp_types:: CompletionItemKind :: VARIABLE ,
118
+ SymbolKind :: LifetimeParam => lsp_types:: CompletionItemKind :: TYPE_PARAMETER ,
119
+ SymbolKind :: Local => lsp_types:: CompletionItemKind :: VARIABLE ,
120
+ SymbolKind :: Macro => lsp_types:: CompletionItemKind :: METHOD ,
121
+ SymbolKind :: Module => lsp_types:: CompletionItemKind :: MODULE ,
122
+ SymbolKind :: SelfParam => lsp_types:: CompletionItemKind :: VALUE ,
123
+ SymbolKind :: Static => lsp_types:: CompletionItemKind :: VALUE ,
124
+ SymbolKind :: Struct => lsp_types:: CompletionItemKind :: STRUCT ,
125
+ SymbolKind :: Trait => lsp_types:: CompletionItemKind :: INTERFACE ,
126
+ SymbolKind :: TypeAlias => lsp_types:: CompletionItemKind :: STRUCT ,
127
+ SymbolKind :: TypeParam => lsp_types:: CompletionItemKind :: TYPE_PARAMETER ,
128
+ SymbolKind :: Union => lsp_types:: CompletionItemKind :: STRUCT ,
129
+ SymbolKind :: ValueParam => lsp_types:: CompletionItemKind :: VALUE ,
130
+ SymbolKind :: Variant => lsp_types:: CompletionItemKind :: ENUM_MEMBER ,
131
131
} ,
132
132
}
133
133
}
@@ -165,7 +165,7 @@ pub(crate) fn snippet_text_edit(
165
165
) -> lsp_ext:: SnippetTextEdit {
166
166
let text_edit = text_edit ( line_index, indel) ;
167
167
let insert_text_format =
168
- if is_snippet { Some ( lsp_types:: InsertTextFormat :: Snippet ) } else { None } ;
168
+ if is_snippet { Some ( lsp_types:: InsertTextFormat :: SNIPPET ) } else { None } ;
169
169
lsp_ext:: SnippetTextEdit {
170
170
range : text_edit. range ,
171
171
new_text : text_edit. new_text ,
@@ -259,15 +259,15 @@ fn completion_item(
259
259
set_score ( & mut lsp_item, max_relevance, item. relevance ( ) ) ;
260
260
261
261
if item. deprecated ( ) {
262
- lsp_item. tags = Some ( vec ! [ lsp_types:: CompletionItemTag :: Deprecated ] )
262
+ lsp_item. tags = Some ( vec ! [ lsp_types:: CompletionItemTag :: DEPRECATED ] )
263
263
}
264
264
265
265
if item. trigger_call_info ( ) && config. client_commands ( ) . trigger_parameter_hints {
266
266
lsp_item. command = Some ( command:: trigger_parameter_hints ( ) ) ;
267
267
}
268
268
269
269
if item. is_snippet ( ) {
270
- lsp_item. insert_text_format = Some ( lsp_types:: InsertTextFormat :: Snippet ) ;
270
+ lsp_item. insert_text_format = Some ( lsp_types:: InsertTextFormat :: SNIPPET ) ;
271
271
}
272
272
if config. completion ( ) . enable_imports_on_the_fly {
273
273
if let imports @ [ _, ..] = item. imports_to_add ( ) {
@@ -786,7 +786,7 @@ pub(crate) fn snippet_text_document_ops(
786
786
let text_edit = lsp_ext:: SnippetTextEdit {
787
787
range : lsp_types:: Range :: default ( ) ,
788
788
new_text : initial_contents,
789
- insert_text_format : Some ( lsp_types:: InsertTextFormat :: PlainText ) ,
789
+ insert_text_format : Some ( lsp_types:: InsertTextFormat :: PLAIN_TEXT ) ,
790
790
annotation_id : None ,
791
791
} ;
792
792
let edit_file =
@@ -908,7 +908,7 @@ pub(crate) fn call_hierarchy_item(
908
908
) -> Result < lsp_types:: CallHierarchyItem > {
909
909
let name = target. name . to_string ( ) ;
910
910
let detail = target. description . clone ( ) ;
911
- let kind = target. kind . map ( symbol_kind) . unwrap_or ( lsp_types:: SymbolKind :: Function ) ;
911
+ let kind = target. kind . map ( symbol_kind) . unwrap_or ( lsp_types:: SymbolKind :: FUNCTION ) ;
912
912
let ( uri, range, selection_range) = location_info ( snap, target) ?;
913
913
Ok ( lsp_types:: CallHierarchyItem {
914
914
name,
0 commit comments