Compare commits
No commits in common. "ed50776aaeadc0ebee99ed8c5dfb79669a855e63" and "2c28091fe5ccfe66b304da0532b46f98fa1c28d3" have entirely different histories.
ed50776aae
...
2c28091fe5
2 changed files with 60 additions and 0 deletions
|
@ -17,6 +17,8 @@ lang_fn: LangFn,
|
|||
extensions: []const []const u8,
|
||||
first_line_matches: ?FirstLineMatch = null,
|
||||
comment: []const u8,
|
||||
formatter: ?[]const []const u8,
|
||||
language_server: ?[]const []const u8,
|
||||
|
||||
pub fn get_by_name_static(name: []const u8) ?FileType {
|
||||
return FileType.static_file_types.get(name);
|
||||
|
@ -127,6 +129,8 @@ fn load_file_types(comptime Namespace: type) []const ListEntry {
|
|||
.extensions = vec(args.extensions),
|
||||
.comment = args.comment,
|
||||
.first_line_matches = if (@hasField(@TypeOf(args), "first_line_matches")) args.first_line_matches else null,
|
||||
.formatter = if (@hasField(@TypeOf(args), "formatter")) vec(args.formatter) else null,
|
||||
.language_server = if (@hasField(@TypeOf(args), "language_server")) vec(args.language_server) else null,
|
||||
} };
|
||||
i += 1;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ pub const astro = .{
|
|||
.icon = "",
|
||||
.extensions = .{"astro"},
|
||||
.comment = "//",
|
||||
.language_server = .{ "astro-ls", "--stdio" },
|
||||
};
|
||||
|
||||
pub const bash = .{
|
||||
|
@ -21,6 +22,8 @@ pub const bash = .{
|
|||
.extensions = .{ "sh", "bash", ".profile" },
|
||||
.comment = "#",
|
||||
.first_line_matches = FirstLineMatch{ .prefix = "#!", .content = "sh" },
|
||||
.formatter = .{ "shfmt", "--indent", "4" },
|
||||
.language_server = .{ "bash-language-server", "start" },
|
||||
};
|
||||
|
||||
pub const c = .{
|
||||
|
@ -28,6 +31,8 @@ pub const c = .{
|
|||
.icon = "",
|
||||
.extensions = .{"c"},
|
||||
.comment = "//",
|
||||
.formatter = .{"clang-format"},
|
||||
.language_server = .{"clangd"},
|
||||
};
|
||||
|
||||
pub const @"c-sharp" = .{
|
||||
|
@ -36,6 +41,8 @@ pub const @"c-sharp" = .{
|
|||
.icon = "",
|
||||
.extensions = .{"cs"},
|
||||
.comment = "//",
|
||||
.language_server = .{ "OmniSharp", "-lsp" },
|
||||
.formatter = .{ "csharpier", "format" },
|
||||
};
|
||||
|
||||
pub const conf = .{
|
||||
|
@ -56,6 +63,8 @@ pub const cmake = .{
|
|||
.comment = "#",
|
||||
.highlights = "queries/cmake/highlights.scm",
|
||||
.injections = "queries/cmake/injections.scm",
|
||||
.formatter = .{"cmake-format"},
|
||||
.language_server = .{"cmake-language-server"},
|
||||
};
|
||||
|
||||
pub const cpp = .{
|
||||
|
@ -69,6 +78,8 @@ pub const cpp = .{
|
|||
"tree-sitter-cpp/queries/highlights.scm",
|
||||
},
|
||||
.injections = "tree-sitter-cpp/queries/injections.scm",
|
||||
.formatter = .{"clang-format"},
|
||||
.language_server = .{"clangd"},
|
||||
};
|
||||
|
||||
pub const css = .{
|
||||
|
@ -77,6 +88,7 @@ pub const css = .{
|
|||
.icon = "",
|
||||
.extensions = .{"css"},
|
||||
.comment = "//",
|
||||
.language_server = .{ "vscode-css-language-server", "--stdio" },
|
||||
};
|
||||
|
||||
pub const diff = .{
|
||||
|
@ -108,6 +120,8 @@ pub const elixir = .{
|
|||
.extensions = .{ "ex", "exs" },
|
||||
.comment = "#",
|
||||
.injections = "tree-sitter-elixir/queries/injections.scm",
|
||||
.formatter = .{ "mix", "format", "-" },
|
||||
.language_server = .{"elixir-ls"},
|
||||
};
|
||||
|
||||
pub const fish = .{
|
||||
|
@ -141,6 +155,8 @@ pub const gleam = .{
|
|||
.icon = "",
|
||||
.extensions = .{"gleam"},
|
||||
.comment = "//",
|
||||
.language_server = .{ "gleam", "lsp" },
|
||||
.formatter = .{ "gleam", "format", "--stdin" },
|
||||
};
|
||||
|
||||
pub const go = .{
|
||||
|
@ -149,6 +165,8 @@ pub const go = .{
|
|||
.icon = "",
|
||||
.extensions = .{"go"},
|
||||
.comment = "//",
|
||||
.language_server = .{"gopls"},
|
||||
.formatter = .{"gofmt"},
|
||||
};
|
||||
|
||||
pub const hare = .{
|
||||
|
@ -163,6 +181,7 @@ pub const haskell = .{
|
|||
.icon = "",
|
||||
.extensions = .{"hs"},
|
||||
.comment = "--",
|
||||
.language_server = .{ "haskell-language-server-wrapper", "lsp" },
|
||||
};
|
||||
|
||||
pub const html = .{
|
||||
|
@ -172,6 +191,8 @@ pub const html = .{
|
|||
.extensions = .{"html"},
|
||||
.comment = "<!--",
|
||||
.injections = "tree-sitter-html/queries/injections.scm",
|
||||
.language_server = .{ "superhtml", "lsp" }, // https://github.com/kristoff-it/super-html.git
|
||||
.formatter = .{ "superhtml", "fmt", "--stdin" },
|
||||
};
|
||||
|
||||
pub const superhtml = .{
|
||||
|
@ -182,6 +203,8 @@ pub const superhtml = .{
|
|||
.comment = "<!--",
|
||||
.highlights = "tree-sitter-superhtml/tree-sitter-superhtml/queries/highlights.scm",
|
||||
.injections = "tree-sitter-superhtml/tree-sitter-superhtml/queries/injections.scm",
|
||||
.language_server = .{ "superhtml", "lsp" },
|
||||
.formatter = .{ "superhtml", "fmt", "--stdin-super" },
|
||||
};
|
||||
|
||||
pub const hurl = .{
|
||||
|
@ -208,12 +231,16 @@ pub const javascript = .{
|
|||
.extensions = .{"js"},
|
||||
.comment = "//",
|
||||
.injections = "tree-sitter-javascript/queries/injections.scm",
|
||||
.language_server = .{ "typescript-language-server", "--stdio" },
|
||||
.formatter = .{ "prettier", "--parser", "typescript" },
|
||||
};
|
||||
|
||||
pub const json = .{
|
||||
.description = "JSON",
|
||||
.extensions = .{"json"},
|
||||
.comment = "//",
|
||||
.language_server = .{ "vscode-json-language-server", "--stdio" },
|
||||
.formatter = .{ "prettier", "--parser", "json" },
|
||||
};
|
||||
|
||||
pub const julia = .{
|
||||
|
@ -222,6 +249,8 @@ pub const julia = .{
|
|||
.icon = "",
|
||||
.extensions = .{"jl"},
|
||||
.comment = "#",
|
||||
.language_server = .{ "julia", "-e", "using LanguageServer; runserver()" },
|
||||
.formatter = .{ "julia", "-e", "using JuliaFormatter; print(format_text(read(stdin, String)))" },
|
||||
};
|
||||
|
||||
pub const kdl = .{
|
||||
|
@ -240,6 +269,7 @@ pub const lua = .{
|
|||
.comment = "--",
|
||||
.injections = "tree-sitter-lua/queries/injections.scm",
|
||||
.first_line_matches = FirstLineMatch{ .prefix = "--", .content = "lua" },
|
||||
.language_server = .{"lua-lsp"},
|
||||
};
|
||||
|
||||
pub const mail = .{
|
||||
|
@ -265,6 +295,8 @@ pub const markdown = .{
|
|||
.comment = "<!--",
|
||||
.highlights = "tree-sitter-markdown/tree-sitter-markdown/queries/highlights.scm",
|
||||
.injections = "tree-sitter-markdown/tree-sitter-markdown/queries/injections.scm",
|
||||
.language_server = .{ "marksman", "server" },
|
||||
.formatter = .{ "prettier", "--parser", "markdown" },
|
||||
};
|
||||
|
||||
pub const @"markdown-inline" = .{
|
||||
|
@ -290,6 +322,7 @@ pub const nim = .{
|
|||
.icon = "",
|
||||
.extensions = .{"nim"},
|
||||
.comment = "#",
|
||||
.language_server = .{"nimlangserver"},
|
||||
};
|
||||
|
||||
pub const nimble = .{
|
||||
|
@ -315,6 +348,8 @@ pub const nix = .{
|
|||
.extensions = .{"nix"},
|
||||
.comment = "#",
|
||||
.injections = "tree-sitter-nix/queries/injections.scm",
|
||||
.language_server = .{"nixd"},
|
||||
.formatter = .{"alejandra"},
|
||||
};
|
||||
|
||||
pub const nu = .{
|
||||
|
@ -323,6 +358,7 @@ pub const nu = .{
|
|||
.icon = ">",
|
||||
.extensions = .{ "nu", "nushell" },
|
||||
.comment = "#",
|
||||
.language_server = .{ "nu", "--lsp" },
|
||||
.highlights = "tree-sitter-nu/queries/nu/highlights.scm",
|
||||
.injections = "tree-sitter-nu/queries/nu/injections.scm",
|
||||
};
|
||||
|
@ -333,6 +369,8 @@ pub const ocaml = .{
|
|||
.icon = "",
|
||||
.extensions = .{ "ml", "mli" },
|
||||
.comment = "(*",
|
||||
.formatter = .{ "ocamlformat", "--profile=ocamlformat", "-" },
|
||||
.language_server = .{ "ocamllsp", "--fallback-read-dot-merlin" },
|
||||
};
|
||||
|
||||
pub const odin = .{
|
||||
|
@ -341,6 +379,8 @@ pub const odin = .{
|
|||
.comment = "//",
|
||||
.parser = @import("file_type.zig").Parser("odin"),
|
||||
.injections = "tree-sitter-odin/queries/injections.scm",
|
||||
.language_server = .{"ols"},
|
||||
.formatter = .{ "odinfmt", "-stdin" },
|
||||
};
|
||||
|
||||
pub const openscad = .{
|
||||
|
@ -350,6 +390,7 @@ pub const openscad = .{
|
|||
.extensions = .{"scad"},
|
||||
.comment = "//",
|
||||
.injections = "tree-sitter-openscad/queries/injections.scm",
|
||||
.language_server = .{"openscad-lsp"},
|
||||
};
|
||||
|
||||
pub const org = .{
|
||||
|
@ -366,6 +407,7 @@ pub const php = .{
|
|||
.extensions = .{"php"},
|
||||
.comment = "//",
|
||||
.injections = "tree-sitter-php/queries/injections.scm",
|
||||
.language_server = .{ "intelephense", "--stdio" },
|
||||
};
|
||||
|
||||
pub const powershell = .{
|
||||
|
@ -398,6 +440,7 @@ pub const python = .{
|
|||
.extensions = .{ "py", "pyi" },
|
||||
.comment = "#",
|
||||
.first_line_matches = FirstLineMatch{ .prefix = "#!", .content = "python" },
|
||||
.language_server = .{"pylsp"},
|
||||
};
|
||||
|
||||
pub const regex = .{
|
||||
|
@ -420,6 +463,7 @@ pub const ruby = .{
|
|||
.icon = "",
|
||||
.extensions = .{"rb"},
|
||||
.comment = "#",
|
||||
.language_server = .{"ruby-lsp"},
|
||||
};
|
||||
|
||||
pub const rust = .{
|
||||
|
@ -429,6 +473,8 @@ pub const rust = .{
|
|||
.extensions = .{"rs"},
|
||||
.comment = "//",
|
||||
.injections = "tree-sitter-rust/queries/injections.scm",
|
||||
.language_server = .{"rust-analyzer"},
|
||||
.formatter = .{"rustfmt"},
|
||||
};
|
||||
|
||||
pub const scheme = .{
|
||||
|
@ -456,6 +502,8 @@ pub const swift = .{
|
|||
.icon = "",
|
||||
.extensions = .{ "swift", "swiftinterface" },
|
||||
.comment = "//",
|
||||
.language_server = .{"sourcekit-lsp"},
|
||||
.formatter = .{"swift-format"},
|
||||
};
|
||||
|
||||
pub const verilog = .{
|
||||
|
@ -464,6 +512,8 @@ pub const verilog = .{
|
|||
.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 = .{
|
||||
|
@ -480,6 +530,8 @@ pub const typescript = .{
|
|||
.icon = "",
|
||||
.extensions = .{ "ts", "tsx" },
|
||||
.comment = "//",
|
||||
.language_server = .{ "typescript-language-server", "--stdio" },
|
||||
.formatter = .{ "prettier", "--parser", "typescript" },
|
||||
};
|
||||
|
||||
pub const typst = .{
|
||||
|
@ -488,6 +540,7 @@ pub const typst = .{
|
|||
.icon = "t",
|
||||
.extensions = .{ "typst", "typ" },
|
||||
.comment = "//",
|
||||
.language_server = .{"tinymist"},
|
||||
.highlights = "tree-sitter-typst/queries/typst/highlights.scm",
|
||||
.injections = "tree-sitter-typst/queries/typst/injections.scm",
|
||||
};
|
||||
|
@ -515,6 +568,7 @@ pub const xml = .{
|
|||
.comment = "<!--",
|
||||
.highlights = "tree-sitter-xml/queries/xml/highlights.scm",
|
||||
.first_line_matches = FirstLineMatch{ .prefix = "<?xml " },
|
||||
.formatter = .{ "xmllint", "--format", "-" },
|
||||
};
|
||||
|
||||
pub const yaml = .{
|
||||
|
@ -531,6 +585,8 @@ pub const zig = .{
|
|||
.icon = "",
|
||||
.extensions = .{ "zig", "zon" },
|
||||
.comment = "//",
|
||||
.formatter = .{ "zig", "fmt", "--stdin" },
|
||||
.language_server = .{"zls"},
|
||||
.injections = "tree-sitter-zig/queries/injections.scm",
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue