diff --git a/src/snippets.zig b/src/snippets.zig index acd9bcb14..750becb74 100644 --- a/src/snippets.zig +++ b/src/snippets.zig @@ -21,7 +21,22 @@ pub const top_level_decl_data = [_]Snipped{ .{ .label = "union tagged", .kind = .Snippet, .text = "const $1 = union(${2:enum}) {$0};" }, .{ .label = "test", .kind = .Snippet, .text = "test \"$1\" {$0}" }, .{ .label = "main", .kind = .Snippet, .text = "pub fn main() !void {$0}" }, - .{ .label = "std_options", .kind = .Snippet, .text = "pub const std_options: std.Options = .{${0}};" }, + .{ .label = "std_options", .kind = .Snippet, .text = "pub const std_options: std.Options = .{$0};" }, + .{ .label = "logFn", .kind = .Snippet, .text = + \\fn logFn( + \\ comptime level: std.log.Level, + \\ comptime scope: @Type(.enum_literal), + \\ comptime fmt: []const u8, + \\ args: anytype, + \\) void {$0} + }, + .{ .label = "panic", .kind = .Snippet, .text = + \\pub fn panic( + \\ msg: []const u8, + \\ trace: ?*std.builtin.StackTrace, + \\ ret_addr: ?usize, + \\) noreturn {$0} + }, }; pub const generic = [_]Snipped{ @@ -85,6 +100,14 @@ pub const generic = [_]Snipped{ .{ .label = "log warn", .kind = .Snippet, .text = "std.log.warn(\"$1\", .{$0});" }, .{ .label = "log info", .kind = .Snippet, .text = "std.log.info(\"$1\", .{$0});" }, .{ .label = "log debug", .kind = .Snippet, .text = "std.log.debug(\"$1\", .{$0});" }, + .{ .label = "format", .kind = .Snippet, .text = + \\pub fn format( + \\ self: ${1:@This()}, + \\ comptime fmt: []const u8, + \\ options: std.fmt.FormatOptions, + \\ writer: anytype, + \\) !void {$0} + }, // types .{ .label = "anyerror", .kind = .Keyword },