Merge pull request #670 from Techatrix/dont-inline-builtin-data

don't use inline for iterating builtin data
This commit is contained in:
Techatrix 2022-09-22 17:58:20 +00:00 committed by GitHub
commit adb012001f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -877,9 +877,9 @@ fn hoverDefinitionBuiltin(server: *Server, writer: anytype, id: types.RequestId,
const name = identifierFromPosition(pos_index, handle.*); const name = identifierFromPosition(pos_index, handle.*);
if (name.len == 0) return try respondGeneric(writer, id, null_result_response); if (name.len == 0) return try respondGeneric(writer, id, null_result_response);
inline for (data.builtins) |builtin| { for (data.builtins) |builtin| {
if (std.mem.eql(u8, builtin.name[1..], name)) { if (std.mem.eql(u8, builtin.name[1..], name)) {
try send(writer, server.arena.allocator(), types.Response{ return try send(writer, server.arena.allocator(), types.Response{
.id = id, .id = id,
.result = .{ .result = .{
.Hover = .{ .Hover = .{
@ -895,6 +895,8 @@ fn hoverDefinitionBuiltin(server: *Server, writer: anytype, id: types.RequestId,
}); });
} }
} }
return try respondGeneric(writer, id, null_result_response);
} }
fn hoverDefinitionGlobal(server: *Server, writer: anytype, id: types.RequestId, pos_index: usize, handle: *DocumentStore.Handle) !void { fn hoverDefinitionGlobal(server: *Server, writer: anytype, id: types.RequestId, pos_index: usize, handle: *DocumentStore.Handle) !void {