fix: handle missing completion items in language server response

This commit is contained in:
CJ van den Berg 2025-12-26 20:28:35 +01:00
parent a623814dfb
commit 37bb88b31c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1266,7 +1266,12 @@ fn send_completion_list(to: tp.pid_ref, file_path: []const u8, row: usize, col:
try cbor.skipValue(&iter); try cbor.skipValue(&iter);
} }
} }
return send_completion_items(to, file_path, row, col, items, is_incomplete); return if (items.len > 0)
send_completion_items(to, file_path, row, col, items, is_incomplete)
else
to.send(.{ "cmd", "add_completion_done", .{ file_path, row, col } }) catch |e| {
std.log.err("send add_completion_done failed: {t}", .{e});
};
} }
pub const CompletionItemError = error{ pub const CompletionItemError = error{