fix builtin completions if label_details_support
is false (#924)
This commit is contained in:
parent
fa5828496e
commit
1ed8d49b30
@ -1326,16 +1326,15 @@ fn completeBuiltin(server: *Server) error{OutOfMemory}!?[]types.CompletionItem {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var completions = try allocator.alloc(types.CompletionItem, builtin_completions.items.len);
|
var completions = try builtin_completions.clone(allocator);
|
||||||
|
|
||||||
if (server.client_capabilities.label_details_support) {
|
if (server.client_capabilities.label_details_support) {
|
||||||
for (builtin_completions.items) |item, i| {
|
for (completions.items) |*item| {
|
||||||
completions[i] = item;
|
try formatDetailledLabel(item, allocator);
|
||||||
try formatDetailledLabel(&completions[i], allocator);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return completions;
|
return completions.items;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn completeGlobal(server: *Server, pos_index: usize, handle: *const DocumentStore.Handle) error{OutOfMemory}![]types.CompletionItem {
|
fn completeGlobal(server: *Server, pos_index: usize, handle: *const DocumentStore.Handle) error{OutOfMemory}![]types.CompletionItem {
|
||||||
|
Loading…
Reference in New Issue
Block a user