Merge commit 'f3c35545e3ba6038460bab1d130be54eb1067a29' into zig-0.14
This commit is contained in:
commit
942e8dfd4c
4 changed files with 74 additions and 12 deletions
|
@ -19,6 +19,7 @@ pub fn build(b: *std.Build) void {
|
||||||
.{ .name = "treez", .module = tree_sitter_dep.module("treez") },
|
.{ .name = "treez", .module = tree_sitter_dep.module("treez") },
|
||||||
ts_queryfile(b, tree_sitter_dep, "queries/cmake/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "queries/cmake/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-agda/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-agda/queries/highlights.scm"),
|
||||||
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-astro/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-bash/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-bash/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-c-sharp/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-c-sharp/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-c/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-c/queries/highlights.scm"),
|
||||||
|
@ -65,6 +66,7 @@ pub fn build(b: *std.Build) void {
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-scala/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-scala/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-scheme/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-scheme/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-superhtml/tree-sitter-superhtml/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-superhtml/tree-sitter-superhtml/queries/highlights.scm"),
|
||||||
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-sql/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-swift/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-swift/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-toml/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-toml/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-typescript/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-typescript/queries/highlights.scm"),
|
||||||
|
@ -76,8 +78,10 @@ pub fn build(b: *std.Build) void {
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-zig/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-zig/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-ziggy/tree-sitter-ziggy/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-ziggy/tree-sitter-ziggy/queries/highlights.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-ziggy/tree-sitter-ziggy-schema/queries/highlights.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-ziggy/tree-sitter-ziggy-schema/queries/highlights.scm"),
|
||||||
|
ts_queryfile(b, tree_sitter_dep, "nvim-treesitter/queries/verilog/highlights.scm"),
|
||||||
|
|
||||||
ts_queryfile(b, tree_sitter_dep, "queries/cmake/injections.scm"),
|
ts_queryfile(b, tree_sitter_dep, "queries/cmake/injections.scm"),
|
||||||
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-astro/queries/injections.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-cpp/queries/injections.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-cpp/queries/injections.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-elixir/queries/injections.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-elixir/queries/injections.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-gitcommit/queries/injections.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-gitcommit/queries/injections.scm"),
|
||||||
|
@ -102,6 +106,7 @@ pub fn build(b: *std.Build) void {
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-typst/queries/typst/injections.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-typst/queries/typst/injections.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-vim/queries/vim/injections.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-vim/queries/vim/injections.scm"),
|
||||||
ts_queryfile(b, tree_sitter_dep, "tree-sitter-zig/queries/injections.scm"),
|
ts_queryfile(b, tree_sitter_dep, "tree-sitter-zig/queries/injections.scm"),
|
||||||
|
ts_queryfile(b, tree_sitter_dep, "nvim-treesitter/queries/verilog/injections.scm"),
|
||||||
} else &.{
|
} else &.{
|
||||||
.{ .name = "build_options", .module = options_mod },
|
.{ .name = "build_options", .module = options_mod },
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.@"tree-sitter" = .{
|
.@"tree-sitter" = .{
|
||||||
.url = "https://github.com/neurocyte/tree-sitter/releases/download/master-aea6072c6178d5cd0c97fff33e130f632f355bc2/source.tar.gz",
|
.url = "https://github.com/neurocyte/tree-sitter/releases/download/master-86dd4d2536f2748c5b4ea0e1e70678039a569aac/source.tar.gz",
|
||||||
.hash = "12204c99c6093230023380068f386f7eb32ab83df9a8eb8b586ffe5aa44afa34ff0e",
|
.hash = "1220e9fba96c468283129e977767472dee00b16f356e5912431cec8f1a009b6691a2",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const ft = @import("file_type.zig");
|
const file_type = @import("file_type.zig");
|
||||||
|
const FirstLineMatch = file_type.FirstLineMatch;
|
||||||
|
|
||||||
pub const agda = .{
|
pub const agda = .{
|
||||||
.description = "Agda",
|
.description = "Agda",
|
||||||
|
@ -6,13 +7,21 @@ pub const agda = .{
|
||||||
.comment = "--",
|
.comment = "--",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const astro = .{
|
||||||
|
.description = "Astro",
|
||||||
|
.icon = "",
|
||||||
|
.extensions = .{"astro"},
|
||||||
|
.comment = "//",
|
||||||
|
.language_server = .{ "astro-ls", "--stdio" },
|
||||||
|
};
|
||||||
|
|
||||||
pub const bash = .{
|
pub const bash = .{
|
||||||
.description = "Bash",
|
.description = "Bash",
|
||||||
.color = 0x3e474a,
|
.color = 0x3e474a,
|
||||||
.icon = "",
|
.icon = "",
|
||||||
.extensions = .{ "sh", "bash", ".profile" },
|
.extensions = .{ "sh", "bash", ".profile" },
|
||||||
.comment = "#",
|
.comment = "#",
|
||||||
.first_line_matches = ft.FirstLineMatch{ .prefix = "#!", .content = "sh" },
|
.first_line_matches = FirstLineMatch{ .prefix = "#!", .content = "sh" },
|
||||||
.formatter = .{ "shfmt", "--indent", "4" },
|
.formatter = .{ "shfmt", "--indent", "4" },
|
||||||
.language_server = .{ "bash-language-server", "start" },
|
.language_server = .{ "bash-language-server", "start" },
|
||||||
};
|
};
|
||||||
|
@ -39,7 +48,7 @@ pub const conf = .{
|
||||||
.description = "Config",
|
.description = "Config",
|
||||||
.color = 0x000000,
|
.color = 0x000000,
|
||||||
.icon = "",
|
.icon = "",
|
||||||
.extensions = .{ "conf", "config", ".gitconfig" },
|
.extensions = .{ "conf", "config", ".gitconfig", "gui_config" },
|
||||||
.highlights = fish.highlights,
|
.highlights = fish.highlights,
|
||||||
.comment = "#",
|
.comment = "#",
|
||||||
.parser = fish.parser,
|
.parser = fish.parser,
|
||||||
|
@ -82,7 +91,7 @@ pub const css = .{
|
||||||
|
|
||||||
pub const diff = .{
|
pub const diff = .{
|
||||||
.description = "Diff",
|
.description = "Diff",
|
||||||
.extensions = .{ "diff", "patch" },
|
.extensions = .{ "diff", "patch", "rej" },
|
||||||
.comment = "#",
|
.comment = "#",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -229,6 +238,7 @@ pub const julia = .{
|
||||||
.extensions = .{"jl"},
|
.extensions = .{"jl"},
|
||||||
.comment = "#",
|
.comment = "#",
|
||||||
.language_server = .{ "julia", "-e", "using LanguageServer; runserver()" },
|
.language_server = .{ "julia", "-e", "using LanguageServer; runserver()" },
|
||||||
|
.formatter = .{ "julia", "-e", "using JuliaFormatter; print(format_text(read(stdin, String)))" },
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const kdl = .{
|
pub const kdl = .{
|
||||||
|
@ -246,7 +256,7 @@ pub const lua = .{
|
||||||
.extensions = .{"lua"},
|
.extensions = .{"lua"},
|
||||||
.comment = "--",
|
.comment = "--",
|
||||||
.injections = "tree-sitter-lua/queries/injections.scm",
|
.injections = "tree-sitter-lua/queries/injections.scm",
|
||||||
.first_line_matches = ft.FirstLineMatch{ .prefix = "--", .content = "lua" },
|
.first_line_matches = FirstLineMatch{ .prefix = "--", .content = "lua" },
|
||||||
.language_server = .{"lua-lsp"},
|
.language_server = .{"lua-lsp"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -256,7 +266,7 @@ pub const mail = .{
|
||||||
.extensions = .{ "eml", "mbox" },
|
.extensions = .{ "eml", "mbox" },
|
||||||
.comment = ">",
|
.comment = ">",
|
||||||
.highlights = "tree-sitter-mail/queries/mail/highlights.scm",
|
.highlights = "tree-sitter-mail/queries/mail/highlights.scm",
|
||||||
.first_line_matches = ft.FirstLineMatch{ .prefix = "From" },
|
.first_line_matches = FirstLineMatch{ .prefix = "From" },
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const make = .{
|
pub const make = .{
|
||||||
|
@ -399,7 +409,7 @@ pub const python = .{
|
||||||
.icon = "",
|
.icon = "",
|
||||||
.extensions = .{ "py", "pyi" },
|
.extensions = .{ "py", "pyi" },
|
||||||
.comment = "#",
|
.comment = "#",
|
||||||
.first_line_matches = ft.FirstLineMatch{ .prefix = "#!", .content = "python" },
|
.first_line_matches = FirstLineMatch{ .prefix = "#!", .content = "python" },
|
||||||
.language_server = .{"pylsp"},
|
.language_server = .{"pylsp"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -426,6 +436,7 @@ pub const rust = .{
|
||||||
.comment = "//",
|
.comment = "//",
|
||||||
.injections = "tree-sitter-rust/queries/injections.scm",
|
.injections = "tree-sitter-rust/queries/injections.scm",
|
||||||
.language_server = .{"rust-analyzer"},
|
.language_server = .{"rust-analyzer"},
|
||||||
|
.formatter = .{"rustfmt"},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const scheme = .{
|
pub const scheme = .{
|
||||||
|
@ -434,6 +445,13 @@ pub const scheme = .{
|
||||||
.comment = ";",
|
.comment = ";",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const sql = .{
|
||||||
|
.description = "SQL",
|
||||||
|
.icon = "",
|
||||||
|
.extensions = .{"sql"},
|
||||||
|
.comment = "--",
|
||||||
|
};
|
||||||
|
|
||||||
pub const @"ssh-config" = .{
|
pub const @"ssh-config" = .{
|
||||||
.description = "SSH config",
|
.description = "SSH config",
|
||||||
.extensions = .{".ssh/config"},
|
.extensions = .{".ssh/config"},
|
||||||
|
@ -450,6 +468,16 @@ pub const swift = .{
|
||||||
.formatter = .{"swift-format"},
|
.formatter = .{"swift-format"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const verilog = .{
|
||||||
|
.description = "SystemVerilog",
|
||||||
|
.extensions = .{ "sv", "svh" },
|
||||||
|
.comment = "//",
|
||||||
|
.highlights = "nvim-treesitter/queries/verilog/highlights.scm",
|
||||||
|
.injections = "nvim-treesitter/queries/verilog/injections.scm",
|
||||||
|
.language_server = .{"verible-verilog-ls"},
|
||||||
|
.formatter = .{ "verible-verilog-format", "-" },
|
||||||
|
};
|
||||||
|
|
||||||
pub const toml = .{
|
pub const toml = .{
|
||||||
.description = "TOML",
|
.description = "TOML",
|
||||||
.extensions = .{ "toml", "ini" },
|
.extensions = .{ "toml", "ini" },
|
||||||
|
@ -494,7 +522,7 @@ pub const xml = .{
|
||||||
.extensions = .{"xml"},
|
.extensions = .{"xml"},
|
||||||
.comment = "<!--",
|
.comment = "<!--",
|
||||||
.highlights = "tree-sitter-xml/queries/xml/highlights.scm",
|
.highlights = "tree-sitter-xml/queries/xml/highlights.scm",
|
||||||
.first_line_matches = ft.FirstLineMatch{ .prefix = "<?xml " },
|
.first_line_matches = FirstLineMatch{ .prefix = "<?xml " },
|
||||||
.formatter = .{ "xmllint", "--format", "-" },
|
.formatter = .{ "xmllint", "--format", "-" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -95,10 +95,39 @@ pub const Node = struct {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
pub fn freeSExpressionString(_: []const u8) void {}
|
pub fn freeSExpressionString(_: []const u8) void {}
|
||||||
pub fn getParent(_: *const @This()) *Node {
|
pub fn getParent(_: *const @This()) Node {
|
||||||
return &dummy;
|
return dummy;
|
||||||
|
}
|
||||||
|
pub fn getChild(_: *const @This(), _: usize) Node {
|
||||||
|
return dummy;
|
||||||
|
}
|
||||||
|
pub fn getChildCount(_: *const @This()) usize {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
pub fn getNamedChild(_: *const @This(), _: usize) Node {
|
||||||
|
return dummy;
|
||||||
|
}
|
||||||
|
pub fn getNamedChildCount(_: *const @This()) usize {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
pub fn isNull(_: *const @This()) bool {
|
pub fn isNull(_: *const @This()) bool {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
pub const externs = struct {
|
||||||
|
pub fn ts_node_next_sibling(_: Node) Node {
|
||||||
|
return Node.dummy;
|
||||||
|
}
|
||||||
|
pub fn ts_node_prev_sibling(_: Node) Node {
|
||||||
|
return Node.dummy;
|
||||||
|
}
|
||||||
|
pub fn ts_node_next_named_sibling(_: Node) Node {
|
||||||
|
return Node.dummy;
|
||||||
|
}
|
||||||
|
pub fn ts_node_prev_named_sibling(_: Node) Node {
|
||||||
|
return Node.dummy;
|
||||||
|
}
|
||||||
|
pub fn ts_node_descendant_for_point_range(_: *const Node, _: Point, _: Point) Node {
|
||||||
|
return Node.dummy;
|
||||||
|
}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue