fix: handle completion items with no insert and/or replace coordinates

superhtml fix
This commit is contained in:
CJ van den Berg 2025-09-13 20:06:04 +02:00
parent 67b214675f
commit 76600bc6bd
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1092,8 +1092,8 @@ fn send_completion_item(to: tp.pid_ref, file_path: []const u8, row: usize, col:
try cbor.skipValue(&iter); try cbor.skipValue(&iter);
} }
} }
const insert = textEdit_insert orelse return error.InvalidMessageField; const insert = textEdit_insert orelse Range{ .start = .{ .line = 0, .character = 0 }, .end = .{ .line = 0, .character = 0 } };
const replace = textEdit_replace orelse return error.InvalidMessageField; const replace = textEdit_replace orelse Range{ .start = .{ .line = 0, .character = 0 }, .end = .{ .line = 0, .character = 0 } };
return to.send(.{ return to.send(.{
"cmd", "add_completion", .{ "cmd", "add_completion", .{
file_path, file_path,