Skip to content

Commit 5776c1f

Browse files
committed
Use CompletionItemKinds named tuple instead of literals
This makes it easier to follow the code, no functional change.
1 parent 37068f0 commit 5776c1f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/requests/completions.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,28 +284,28 @@ end
284284
function _completion_kind(b)
285285
if b isa StaticLint.Binding
286286
if b.type == StaticLint.CoreTypes.String
287-
return 1
287+
return CompletionItemKinds.Text
288288
elseif b.type == StaticLint.CoreTypes.Function
289-
return 2
289+
return CompletionItemKinds.Method
290290
elseif b.type == StaticLint.CoreTypes.Module
291-
return 9
291+
return CompletionItemKinds.Module
292292
elseif b.type == Int || b.type == StaticLint.CoreTypes.Float64
293-
return 12
293+
return CompletionItemKinds.Value
294294
elseif b.type == StaticLint.CoreTypes.DataType
295-
return 22
295+
return CompletionItemKinds.Struct
296296
else
297-
return 13
297+
return CompletionItemKinds.Enum
298298
end
299299
elseif b isa SymbolServer.ModuleStore || b isa SymbolServer.VarRef
300-
return 9
300+
return CompletionItemKinds.Module
301301
elseif b isa SymbolServer.MethodStore
302-
return 2
302+
return CompletionItemKinds.Method
303303
elseif b isa SymbolServer.FunctionStore
304-
return 3
304+
return CompletionItemKinds.Function
305305
elseif b isa SymbolServer.DataTypeStore
306-
return 22
306+
return CompletionItemKinds.Struct
307307
else
308-
return 6
308+
return CompletionItemKinds.Variable
309309
end
310310
end
311311

0 commit comments

Comments
 (0)