diff --git a/src/main.zig b/src/main.zig index e9298b5..d092b1c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -35,12 +35,7 @@ var actual_log_level: std.log.Level = switch (std.builtin.mode) { else => .notice, }; -pub fn log( - comptime message_level: std.log.Level, - comptime scope: @Type(.EnumLiteral), - comptime format: []const u8, - args: anytype, -) void { +pub fn log(comptime message_level: std.log.Level, comptime scope: @Type(.EnumLiteral), comptime format: []const u8, args: anytype) void { if (@enumToInt(message_level) > @enumToInt(actual_log_level)) { return; } diff --git a/src/requests.zig b/src/requests.zig index 0be1c11..5638786 100644 --- a/src/requests.zig +++ b/src/requests.zig @@ -51,14 +51,8 @@ fn fromDynamicTreeInternal(arena: *std.heap.ArenaAllocator, value: std.json.Valu const actual_type = if (is_optional) std.meta.Child(field.field_type) else field.field_type; const is_struct = comptime std.meta.trait.is(.Struct)(actual_type); - const is_default = comptime if (is_struct) std.meta.trait.hasDecls(actual_type, .{ - "default", - "value_type", - }) else false; - const is_transform = comptime if (is_struct) std.meta.trait.hasDecls(actual_type, .{ - "original_type", - "transform", - }) else false; + const is_default = comptime if (is_struct) std.meta.trait.hasDecls(actual_type, .{ "default", "value_type" }) else false; + const is_transform = comptime if (is_struct) std.meta.trait.hasDecls(actual_type, .{ "original_type", "transform" }) else false; if (value.Object.get(field.name)) |json_field| { if (is_exists) { diff --git a/src/signature_help.zig b/src/signature_help.zig index 0a1f62d..88168e4 100644 --- a/src/signature_help.zig +++ b/src/signature_help.zig @@ -68,13 +68,7 @@ fn fnProtoToSignatureInfo(document_store: *DocumentStore, arena: *std.heap.Arena }; } -pub fn getSignatureInfo( - document_store: *DocumentStore, - arena: *std.heap.ArenaAllocator, - handle: *DocumentStore.Handle, - absolute_index: usize, - comptime data: type, -) !?types.SignatureInformation { +pub fn getSignatureInfo(document_store: *DocumentStore, arena: *std.heap.ArenaAllocator, handle: *DocumentStore.Handle, absolute_index: usize, comptime data: type) !?types.SignatureInformation { const innermost_block = analysis.innermostBlockScope(handle.*, absolute_index); const tree = handle.tree; const token_tags = tree.tokens.items(.tag); diff --git a/src/types.zig b/src/types.zig index 4e181b4..b336383 100644 --- a/src/types.zig +++ b/src/types.zig @@ -79,12 +79,8 @@ pub const MessageType = enum(i64) { Info = 3, Log = 4, - pub fn jsonStringify( - value: MessageType, - options: json.StringifyOptions, - out_stream: anytype, - ) !void { - try json.stringify(@enumToInt(value), options, out_stream); + pub fn jsonStringify(value: MessageType, options: std.json.StringifyOptions, out_stream: anytype) !void { + try std.json.stringify(@enumToInt(value), options, out_stream); } }; @@ -175,16 +171,12 @@ pub const MarkupContent = struct { PlainText = 0, Markdown = 1, - pub fn jsonStringify( - value: Kind, - options: json.StringifyOptions, - out_stream: anytype, - ) !void { + pub fn jsonStringify(value: Kind, options: std.json.StringifyOptions, out_stream: anytype) !void { const str = switch (value) { .PlainText => "plaintext", .Markdown => "markdown", }; - try json.stringify(str, options, out_stream); + try std.json.stringify(str, options, out_stream); } }; @@ -329,12 +321,8 @@ const InitializeResult = struct { Full = 1, Incremental = 2, - pub fn jsonStringify( - value: @This(), - options: json.StringifyOptions, - out_stream: anytype, - ) !void { - try json.stringify(@enumToInt(value), options, out_stream); + pub fn jsonStringify(value: @This(), options: std.json.StringifyOptions, out_stream: anytype) !void { + try std.json.stringify(@enumToInt(value), options, out_stream); } }, renameProvider: bool,