From 670aa9aedefcd2832aa85a6ea0c2f5e2d6e0fdbe Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 4 Feb 2025 22:59:18 +0100 Subject: [PATCH] build: update to zig 0.14.0-dev.3039 --- src/file_type.zig | 4 ++-- src/file_types.zig | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/file_type.zig b/src/file_type.zig index dfecb1b..d6c4445 100644 --- a/src/file_type.zig +++ b/src/file_type.zig @@ -88,7 +88,7 @@ fn ft_func_name(comptime lang: []const u8) []const u8 { const LangFn = *const fn () callconv(.C) ?*const treez.Language; -const FirstLineMatch = struct { +pub const FirstLineMatch = struct { prefix: ?[]const u8 = null, content: ?[]const u8 = null, }; @@ -105,7 +105,7 @@ fn vec(comptime args: anytype) []const []const u8 { fn load_file_types(comptime Namespace: type) []const FileType { comptime switch (@typeInfo(Namespace)) { - .Struct => |info| { + .@"struct" => |info| { var count = 0; for (info.decls) |_| { // @compileLog(decl.name, @TypeOf(@field(Namespace, decl.name))); diff --git a/src/file_types.zig b/src/file_types.zig index a634930..c5f0895 100644 --- a/src/file_types.zig +++ b/src/file_types.zig @@ -1,3 +1,6 @@ +const file_type = @import("file_type.zig"); +const FirstLineMatch = file_type.FirstLineMatch; + pub const agda = .{ .description = "Agda", .extensions = .{"agda"}, @@ -10,7 +13,7 @@ pub const bash = .{ .icon = "󱆃", .extensions = .{ "sh", "bash", ".profile" }, .comment = "#", - .first_line_matches = .{ .prefix = "#!", .content = "sh" }, + .first_line_matches = FirstLineMatch{ .prefix = "#!", .content = "sh" }, .formatter = .{ "shfmt", "--indent", "4" }, .language_server = .{ "bash-language-server", "start" }, }; @@ -245,7 +248,7 @@ pub const lua = .{ .extensions = .{"lua"}, .comment = "--", .injections = "tree-sitter-lua/queries/injections.scm", - .first_line_matches = .{ .prefix = "--", .content = "lua" }, + .first_line_matches = FirstLineMatch{ .prefix = "--", .content = "lua" }, .language_server = .{"lua-lsp"}, }; @@ -255,7 +258,7 @@ pub const mail = .{ .extensions = .{ "eml", "mbox" }, .comment = ">", .highlights = "tree-sitter-mail/queries/mail/highlights.scm", - .first_line_matches = .{ .prefix = "From" }, + .first_line_matches = FirstLineMatch{ .prefix = "From" }, }; pub const make = .{ @@ -398,7 +401,7 @@ pub const python = .{ .icon = "󰌠", .extensions = .{ "py", "pyi" }, .comment = "#", - .first_line_matches = .{ .prefix = "#!", .content = "python" }, + .first_line_matches = FirstLineMatch{ .prefix = "#!", .content = "python" }, .language_server = .{"pylsp"}, }; @@ -511,7 +514,7 @@ pub const xml = .{ .extensions = .{"xml"}, .comment = "