diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs index a8ea30124e3a2..520d28cc5f29a 100644 --- a/helix-core/src/indent.rs +++ b/helix-core/src/indent.rs @@ -445,6 +445,7 @@ where indent_query: OnceCell::new(), textobject_query: OnceCell::new(), }], + grammar: vec![], }); // set runtime path so we can find the queries diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 3c3f7b3d973dd..1fb75e5ae7123 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -75,6 +75,7 @@ where #[serde(deny_unknown_fields)] pub struct Configuration { pub language: Vec, + pub grammar: Vec, } // largely based on tree-sitter/cli/src/loader.rs @@ -147,6 +148,25 @@ pub struct IndentQuery { pub outdent: HashSet, } +#[derive(Debug, Serialize, Deserialize)] +pub struct GrammarConfiguration { + #[serde(rename = "name")] + pub grammar_id: String, // c-sharp, rust + pub source: GrammarSource, + pub path: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum GrammarSource { + #[serde(rename = "path")] + Local(String), + Git { + remote: String, + rev: String, + }, +} + #[derive(Debug)] pub struct TextObjectQuery { pub query: Query, @@ -1849,7 +1869,10 @@ mod test { .map(String::from) .collect(); - let loader = Loader::new(Configuration { language: vec![] }); + let loader = Loader::new(Configuration { + language: vec![], + grammar: vec![], + }); let language = get_language(&crate::RUNTIME_DIR, "Rust").unwrap(); let config = HighlightConfiguration::new( diff --git a/languages.toml b/languages.toml index ce60e2a0bfae0..a725c42f345fc 100644 --- a/languages.toml +++ b/languages.toml @@ -1,4 +1,5 @@ -[language.rust] +[[language]] +name = "rust" scope = "source.rust" injection-regex = "rust" file-types = ["rs"] @@ -8,10 +9,12 @@ comment-token = "//" language-server = { command = "rust-analyzer" } indent = { tab-width = 4, unit = " " } -[grammar.rust] -source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "a360da0a29a19c281d08295a35ecd0544d2da211" } +[[grammar]] +name = "rust" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-rust", rev = "a360da0a29a19c281d08295a35ecd0544d2da211" } } -[language.toml] +[[language]] +name = "toml" scope = "source.toml" injection-regex = "toml" file-types = ["toml"] @@ -19,10 +22,12 @@ roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } -[grammar.toml] -source = { git = "https://github.com/ikatyang/tree-sitter-toml", rev = "7cff70bbcbbc62001b465603ca1ea88edd668704" } +[[grammar]] +name = "toml" +source = { git = { remote = "https://github.com/ikatyang/tree-sitter-toml", rev = "7cff70bbcbbc62001b465603ca1ea88edd668704" } } -[language.protobuf] +[[language]] +name = "protobuf" scope = "source.proto" injection-regex = "protobuf" file-types = ["proto"] @@ -30,10 +35,12 @@ roots = [] comment-token = "//" indent = { tab-width = 2, unit = " " } -[grammar.protobuf] -source = { git = "https://github.com/yusdacra/tree-sitter-protobuf", rev = "19c211a01434d9f03efff99f85e19f967591b175" } +[[grammar]] +name = "protobuf" +source = { git = { remote = "https://github.com/yusdacra/tree-sitter-protobuf", rev = "19c211a01434d9f03efff99f85e19f967591b175" } } -[language.elixir] +[[language]] +name = "elixir" scope = "source.elixir" injection-regex = "elixir" file-types = ["ex", "exs"] @@ -43,10 +50,12 @@ comment-token = "#" language-server = { command = "elixir-ls" } indent = { tab-width = 2, unit = " " } -[grammar.elixir] -source = { git = "https://github.com/elixir-lang/tree-sitter-elixir", rev = "f5d7bda543da788bd507b05bd722627dde66c9ec" } +[[grammar]] +name = "elixir" +source = { git = { remote = "https://github.com/elixir-lang/tree-sitter-elixir", rev = "f5d7bda543da788bd507b05bd722627dde66c9ec" } } -[language.fish] +[[language]] +name = "fish" scope = "source.fish" injection-regex = "fish" file-types = ["fish"] @@ -55,10 +64,12 @@ roots = [] comment-token = "#" indent = { tab-width = 4, unit = " " } -[grammar.fish] -source = { git = "https://github.com/ram02z/tree-sitter-fish", rev = "04e54ab6585dfd4fee6ddfe5849af56f101b6d4f" } +[[grammar]] +name = "fish" +source = { git = { remote = "https://github.com/ram02z/tree-sitter-fish", rev = "04e54ab6585dfd4fee6ddfe5849af56f101b6d4f" } } -[language.mint] +[[language]] +name = "mint" scope = "source.mint" injection-regex = "mint" file-types = ["mint"] @@ -68,41 +79,48 @@ comment-token = "//" language-server = { command = "mint", args = ["ls"] } indent = { tab-width = 2, unit = " " } -[language.json] +[[language]] +name = "json" scope = "source.json" injection-regex = "json" file-types = ["json"] roots = [] indent = { tab-width = 2, unit = " " } -[grammar.json] -source = { git = "https://github.com/tree-sitter/tree-sitter-json", rev = "65bceef69c3b0f24c0b19ce67d79f57c96e90fcb" } +[[grammar]] +name = "json" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-json", rev = "65bceef69c3b0f24c0b19ce67d79f57c96e90fcb" } } -[language.c] +[[language]] +name = "c] scope = "source.c" injection-regex = "c" -file-types = ["c"] # TODO: ["h"] +file-types = ["c"" # TODO: ["h"] roots = [] comment-token = "//" language-server = { command = "clangd" } indent = { tab-width = 2, unit = " " } -[grammar.c] -source = { git = "https://github.com/tree-sitter/tree-sitter-c", rev = "f05e279aedde06a25801c3f2b2cc8ac17fac52ae" } +[[grammar]] +name = "c] +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-c", rev = "f05e279aedde06a25801c3f2b2cc8ac17fac52ae" } } -[language.cpp] +[[language]] +name = "cpp" scope = "source.cpp" injection-regex = "cpp" -file-types = ["cc", "hh", "cpp", "hpp", "h", "ipp", "tpp", "cxx", "hxx", "ixx", "txx", "ino"] +file-types = ["cc", "hh", "cpp", "hpp", "h", "ipp", "tpp", "cxx", "hxx", "ixx", "txx", "ino"" roots = [] comment-token = "//" language-server = { command = "clangd" } indent = { tab-width = 2, unit = " " } -[grammar.cpp] -source = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "e8dcc9d2b404c542fd236ea5f7208f90be8a6e89" } +[[grammar]] +name = "cpp" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "e8dcc9d2b404c542fd236ea5f7208f90be8a6e89" } } -[language.c-sharp] +[[language]] +name = "c-sharp" scope = "source.csharp" injection-regex = "c-?sharp" file-types = ["cs"] @@ -110,10 +128,12 @@ roots = [] comment-token = "//" indent = { tab-width = 4, unit = "\t" } -[grammar.c-sharp] -source = { git = "https://github.com/tree-sitter/tree-sitter-c-sharp", rev = "53a65a908167d6556e1fcdb67f1ee62aac101dda" } +[[grammar]] +name = "c-sharp" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-c-sharp", rev = "53a65a908167d6556e1fcdb67f1ee62aac101dda" } } -[language.go] +[[language]] +name = "go" scope = "source.go" injection-regex = "go" file-types = ["go"] @@ -124,10 +144,12 @@ language-server = { command = "gopls" } # TODO: gopls needs utf-8 offsets? indent = { tab-width = 4, unit = "\t" } -[grammar.go] -source = { git = "https://github.com/tree-sitter/tree-sitter-go", rev = "0fa917a7022d1cd2e9b779a6a8fc5dc7fad69c75" } +[[grammar]] +name = "go" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-go", rev = "0fa917a7022d1cd2e9b779a6a8fc5dc7fad69c75" } } -[language.javascript] +[[language]] +name = "javascript" scope = "source.js" injection-regex = "^(js|javascript)$" file-types = ["js", "mjs"] @@ -138,10 +160,12 @@ comment-token = "//" language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "javascript" } indent = { tab-width = 2, unit = " " } -[grammar.javascript] -source = { git = "https://github.com/tree-sitter/tree-sitter-javascript", rev = "4a95461c4761c624f2263725aca79eeaefd36cad" } +[[grammar]] +name = "javascript" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-javascript", rev = "4a95461c4761c624f2263725aca79eeaefd36cad" } } -[language.typescript] +[[language]] +name = "typescript" scope = "source.ts" injection-regex = "^(ts|typescript)$" file-types = ["ts"] @@ -151,11 +175,13 @@ roots = [] language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "typescript"} indent = { tab-width = 2, unit = " " } -[grammar.typescript] -source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a" } +[[grammar]] +name = "typescript" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a" } } path = "typescript" -[language.tsx] +[[language]] +name = "tsx" scope = "source.tsx" injection-regex = "^(tsx)$" # |typescript file-types = ["tsx"] @@ -164,31 +190,37 @@ roots = [] language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "typescriptreact" } indent = { tab-width = 2, unit = " " } -[grammar.tsx] -source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a" } +[[grammar]] +name = "tsx" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a" } } path = "tsx" -[language.css] +[[language]] +name = "css" scope = "source.css" injection-regex = "css" file-types = ["css", "scss"] roots = [] indent = { tab-width = 2, unit = " " } -[grammar.css] -source = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "94e10230939e702b4fa3fa2cb5c3bc7173b95d07" } +[[grammar]] +name = "css" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-css", rev = "94e10230939e702b4fa3fa2cb5c3bc7173b95d07" } } -[language.html] +[[language]] +name = "html" scope = "text.html.basic" injection-regex = "html" file-types = ["html"] roots = [] indent = { tab-width = 2, unit = " " } -[grammar.html] -source = { git = "https://github.com/tree-sitter/tree-sitter-html", rev = "d93af487cc75120c89257195e6be46c999c6ba18" } +[[grammar]] +name = "html" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-html", rev = "d93af487cc75120c89257195e6be46c999c6ba18" } } -[language.python] +[[language]] +name = "python" scope = "source.python" injection-regex = "python" file-types = ["py"] @@ -199,10 +231,12 @@ language-server = { command = "pylsp" } # TODO: pyls needs utf-8 offsets indent = { tab-width = 4, unit = " " } -[grammar.python] -source = { git = "https://github.com/tree-sitter/tree-sitter-python", rev = "d6210ceab11e8d812d4ab59c07c81458ec6e5184" } +[[grammar]] +name = "python" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-python", rev = "d6210ceab11e8d812d4ab59c07c81458ec6e5184" } } -[language.nix] +[[language]] +name = "nix" scope = "source.nix" injection-regex = "nix" file-types = ["nix"] @@ -212,10 +246,12 @@ comment-token = "#" language-server = { command = "rnix-lsp" } indent = { tab-width = 2, unit = " " } -[grammar.nix] -source = { git = "https://github.com/cstrahan/tree-sitter-nix", rev = "50f38ceab667f9d482640edfee803d74f4edeba5" } +[[grammar]] +name = "nix" +source = { git = { remote = "https://github.com/cstrahan/tree-sitter-nix", rev = "50f38ceab667f9d482640edfee803d74f4edeba5" } } -[language.ruby] +[[language]] +name = "ruby" scope = "source.ruby" injection-regex = "ruby" file-types = ["rb"] @@ -225,10 +261,12 @@ comment-token = "#" language-server = { command = "solargraph", args = ["stdio"] } indent = { tab-width = 2, unit = " " } -[grammar.ruby] -source = { git = "https://github.com/tree-sitter/tree-sitter-ruby", rev = "dfff673b41df7fadcbb609c6338f38da3cdd018e" } +[[grammar]] +name = "ruby" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-ruby", rev = "dfff673b41df7fadcbb609c6338f38da3cdd018e" } } -[language.bash] +[[language]] +name = "bash" scope = "source.bash" injection-regex = "bash" file-types = ["sh", "bash", "zsh", ".bash_login", ".bash_logout", ".bash_profile", ".bashrc", ".profile", ".zshenv", ".zlogin", ".zlogout", ".zprofile", ".zshrc"] @@ -238,10 +276,12 @@ comment-token = "#" language-server = { command = "bash-language-server", args = ["start"] } indent = { tab-width = 2, unit = " " } -[grammar.bash] -source = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "a8eb5cb57c66f74c63ab950de081207cccf52017" } +[[grammar]] +name = "bash" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-bash", rev = "a8eb5cb57c66f74c63ab950de081207cccf52017" } } -[language.php] +[[language]] +name = "php" scope = "source.php" injection-regex = "php" file-types = ["php"] @@ -249,20 +289,24 @@ shebangs = ["php"] roots = [] indent = { tab-width = 4, unit = " " } -[grammar.php] -source = { git = "https://github.com/tree-sitter/tree-sitter-php", rev = "57f855461aeeca73bd4218754fb26b5ac143f98f" } +[[grammar]] +name = "php" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-php", rev = "57f855461aeeca73bd4218754fb26b5ac143f98f" } } -[language.twig] +[[language]] +name = "twig" scope = "source.twig" injection-regex = "twig" file-types = ["twig"] roots = [] indent = { tab-width = 2, unit = " " } -[grammar.twig] -source = { git = "https://github.com/eirabben/tree-sitter-twig", rev = "b7444181fb38e603e25ea8fcdac55f9492e49c27" } +[[grammar]] +name = "twig" +source = { git = { remote = "https://github.com/eirabben/tree-sitter-twig", rev = "b7444181fb38e603e25ea8fcdac55f9492e49c27" } } -[language.latex] +[[language]] +name = "latex" scope = "source.tex" injection-regex = "tex" file-types = ["tex"] @@ -270,10 +314,12 @@ roots = [] comment-token = "%" indent = { tab-width = 4, unit = "\t" } -[grammar.latex] -source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "7f720661de5316c0f8fee956526d4002fa1086d8" } +[[grammar]] +name = "latex" +source = { git = { remote = "https://github.com/latex-lsp/tree-sitter-latex", rev = "7f720661de5316c0f8fee956526d4002fa1086d8" } } -[language.lean] +[[language]] +name = "lean" scope = "source.lean" injection-regex = "lean" file-types = ["lean"] @@ -282,10 +328,12 @@ comment-token = "--" language-server = { command = "lean", args = [ "--server" ] } indent = { tab-width = 2, unit = " " } -[grammar.lean] -source = { git = "https://github.com/Julian/tree-sitter-lean", rev = "d98426109258b266e1e92358c5f11716d2e8f638" } +[[grammar]] +name = "lean" +source = { git = { remote = "https://github.com/Julian/tree-sitter-lean", rev = "d98426109258b266e1e92358c5f11716d2e8f638" } } -[language.julia] +[[language]] +name = "julia" scope = "source.julia" injection-regex = "julia" file-types = ["jl"] @@ -308,20 +356,24 @@ language-server = { command = "julia", args = [ ] } indent = { tab-width = 2, unit = " " } -[grammar.julia] -source = { git = "https://github.com/tree-sitter/tree-sitter-julia", rev = "12ea597262125fc22fd2e91aa953ac69b19c26ca" } +[[grammar]] +name = "julia" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-julia", rev = "12ea597262125fc22fd2e91aa953ac69b19c26ca" } } -[language.java] +[[language]] +name = "java" scope = "source.java" injection-regex = "java" file-types = ["java"] roots = ["pom.xml"] indent = { tab-width = 4, unit = " " } -[grammar.java] -source = { git = "https://github.com/tree-sitter/tree-sitter-java", rev = "bd6186c24d5eb13b4623efac9d944dcc095c0dad" } +[[grammar]] +name = "java" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-java", rev = "bd6186c24d5eb13b4623efac9d944dcc095c0dad" } } -[language.ledger] +[[language]] +name = "ledger" scope = "source.ledger" injection-regex = "ledger" file-types = ["ldg", "ledger", "journal"] @@ -329,10 +381,12 @@ roots = [] comment-token = ";" indent = { tab-width = 4, unit = " " } -[grammar.ledger] -source = { git = "https://github.com/cbarrete/tree-sitter-ledger", rev = "0cdeb0e51411a3ba5493662952c3039de08939ca" } +[[grammar]] +name = "ledger" +source = { git = { remote = "https://github.com/cbarrete/tree-sitter-ledger", rev = "0cdeb0e51411a3ba5493662952c3039de08939ca" } } -[language.ocaml] +[[language]] +name = "ocaml" scope = "source.ocaml" injection-regex = "ocaml" file-types = ["ml"] @@ -341,11 +395,13 @@ roots = [] comment-token = "(**)" indent = { tab-width = 2, unit = " " } -[grammar.ocaml] -source = { git = "https://github.com/tree-sitter/tree-sitter-ocaml", rev = "23d419ba45789c5a47d31448061557716b02750a" } +[[grammar]] +name = "ocaml" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-ocaml", rev = "23d419ba45789c5a47d31448061557716b02750a" } } path = "ocaml" -[language.ocaml-interface] +[[language]] +name = "ocaml-interface" scope = "source.ocaml.interface" file-types = ["mli"] shebangs = [] @@ -353,11 +409,13 @@ roots = [] comment-token = "(**)" indent = { tab-width = 2, unit = " "} -[grammar.ocaml-interface] -source = { git = "https://github.com/tree-sitter/tree-sitter-ocaml", rev = "23d419ba45789c5a47d31448061557716b02750a" } +[[grammar]] +name = "ocaml-interface" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-ocaml", rev = "23d419ba45789c5a47d31448061557716b02750a" } } path = "interface" -[language.lua] +[[language]] +name = "lua" scope = "source.lua" file-types = ["lua"] shebangs = ["lua"] @@ -365,10 +423,12 @@ roots = [] comment-token = "--" indent = { tab-width = 2, unit = " " } -[grammar.lua] -source = { git = "https://github.com/nvim-treesitter/tree-sitter-lua", rev = "6f5d40190ec8a0aa8c8410699353d820f4f7d7a6" } +[[grammar]] +name = "lua" +source = { git = { remote = "https://github.com/nvim-treesitter/tree-sitter-lua", rev = "6f5d40190ec8a0aa8c8410699353d820f4f7d7a6" } } -[language.svelte] +[[language]] +name = "svelte" scope = "source.svelte" injection-regex = "svelte" file-types = ["svelte"] @@ -376,20 +436,24 @@ roots = [] indent = { tab-width = 2, unit = " " } language-server = { command = "svelteserver", args = ["--stdio"] } -[grammar.svelte] -source = { git = "https://github.com/Himujjal/tree-sitter-svelte", rev = "349a5984513b4a4a9e143a6e746120c6ff6cf6ed" } +[[grammar]] +name = "svelte" +source = { git = { remote = "https://github.com/Himujjal/tree-sitter-svelte", rev = "349a5984513b4a4a9e143a6e746120c6ff6cf6ed" } } -[language.vue] +[[language]] +name = "vue" scope = "source.vue" injection-regex = "vue" file-types = ["vue"] roots = [] indent = { tab-width = 2, unit = " " } -[grammar.vue] -source = { git = "https://github.com/ikatyang/tree-sitter-vue", rev = "91fe2754796cd8fba5f229505a23fa08f3546c06" } +[[grammar]] +name = "vue" +source = { git = { remote = "https://github.com/ikatyang/tree-sitter-vue", rev = "91fe2754796cd8fba5f229505a23fa08f3546c06" } } -[language.yaml] +[[language]] +name = "yaml" scope = "source.yaml" file-types = ["yml", "yaml"] roots = [] @@ -397,10 +461,12 @@ comment-token = "#" indent = { tab-width = 2, unit = " " } injection-regex = "yml|yaml" -[grammar.yaml] -source = { git = "https://github.com/ikatyang/tree-sitter-yaml", rev = "0e36bed171768908f331ff7dff9d956bae016efb" } +[[grammar]] +name = "yaml" +source = { git = { remote = "https://github.com/ikatyang/tree-sitter-yaml", rev = "0e36bed171768908f331ff7dff9d956bae016efb" } } -[language.haskell] +[[language]] +name = "haskell" scope = "source.haskell" injection-regex = "haskell" file-types = ["hs"] @@ -409,10 +475,12 @@ comment-token = "--" language-server = { command = "haskell-language-server-wrapper", args = ["--lsp"] } indent = { tab-width = 2, unit = " " } -[grammar.haskell] -source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "b6ec26f181dd059eedd506fa5fbeae1b8e5556c8" } +[[grammar]] +name = "haskell" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "b6ec26f181dd059eedd506fa5fbeae1b8e5556c8" } } -[language.zig] +[[language]] +name = "zig" scope = "source.zig" injection-regex = "zig" file-types = ["zig"] @@ -422,10 +490,12 @@ comment-token = "//" language-server = { command = "zls" } indent = { tab-width = 4, unit = " " } -[grammar.zig] -source = { git = "https://github.com/maxxnino/tree-sitter-zig", rev = "93331b8bd8b4ebee2b575490b2758f16ad4e9f30" } +[[grammar]] +name = "zig" +source = { git = { remote = "https://github.com/maxxnino/tree-sitter-zig", rev = "93331b8bd8b4ebee2b575490b2758f16ad4e9f30" } } -[language.prolog] +[[language]] +name = "prolog" scope = "source.prolog" roots = [] file-types = ["pl", "prolog"] @@ -436,7 +506,8 @@ language-server = { command = "swipl", args = [ "-g", "lsp_server:main", "-t", "halt", "--", "stdio"] } -[language.tsq] +[[language]] +name = "tsq" scope = "source.tsq" file-types = ["scm"] roots = [] @@ -444,10 +515,12 @@ comment-token = ";" injection-regex = "tsq" indent = { tab-width = 2, unit = " " } -[grammar.tsq] -source = { git = "https://github.com/tree-sitter/tree-sitter-tsq", rev = "b665659d3238e6036e22ed0e24935e60efb39415" } +[[grammar]] +name = "tsq" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-tsq", rev = "b665659d3238e6036e22ed0e24935e60efb39415" } } -[language.cmake] +[[language]] +name = "cmake" scope = "source.cmake" file-types = ["cmake", "CMakeLists.txt"] roots = [] @@ -456,19 +529,23 @@ indent = { tab-width = 2, unit = " " } language-server = { command = "cmake-language-server" } injection-regex = "cmake" -[grammar.cmake] -source = { git = "https://github.com/uyha/tree-sitter-cmake", rev = "f6616f1e417ee8b62daf251aa1daa5d73781c596" } +[[grammar]] +name = "cmake" +source = { git = { remote = "https://github.com/uyha/tree-sitter-cmake", rev = "f6616f1e417ee8b62daf251aa1daa5d73781c596" } } -[language.make] +[[language]] +name = "make" scope = "source.make" file-types = ["Makefile", "makefile", "justfile", ".justfile"] roots =[] comment-token = "#" -[grammar.make] -source = { git = "https://github.com/alemuller/tree-sitter-make", rev = "a4b9187417d6be349ee5fd4b6e77b4172c6827dd" } +[[grammar]] +name = "make" +source = { git = { remote = "https://github.com/alemuller/tree-sitter-make", rev = "a4b9187417d6be349ee5fd4b6e77b4172c6827dd" } } -[language.glsl] +[[language]] +name = "glsl" scope = "source.glsl" file-types = ["glsl", "vert", "tesc", "tese", "geom", "frag", "comp" ] roots = [] @@ -476,10 +553,12 @@ comment-token = "//" indent = { tab-width = 4, unit = " " } injection-regex = "glsl" -[grammar.glsl] -source = { git = "https://github.com/theHamsta/tree-sitter-glsl", rev = "88408ffc5e27abcffced7010fc77396ae3636d7e" } +[[grammar]] +name = "glsl" +source = { git = { remote = "https://github.com/theHamsta/tree-sitter-glsl", rev = "88408ffc5e27abcffced7010fc77396ae3636d7e" } } -[language.perl] +[[language]] +name = "perl" scope = "source.perl" file-types = ["pl", "pm"] shebangs = ["perl"] @@ -487,10 +566,12 @@ roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } -[grammar.perl] -source = { git = "https://github.com/ganezdragon/tree-sitter-perl", rev = "0ac2c6da562c7a2c26ed7e8691d4a590f7e8b90a" } +[[grammar]] +name = "perl" +source = { git = { remote = "https://github.com/ganezdragon/tree-sitter-perl", rev = "0ac2c6da562c7a2c26ed7e8691d4a590f7e8b90a" } } -[language.racket] +[[language]] +name = "racket" scope = "source.rkt" roots = [] file-types = ["rkt"] @@ -498,26 +579,31 @@ shebangs = ["racket"] comment-token = ";" language-server = { command = "racket", args = ["-l", "racket-langserver"] } -[language.comment] +[[language]] +name = "comment" scope = "scope.comment" roots = [] file-types = [] injection-regex = "comment" -[grammar.comment] -source = { git = "https://github.com/stsewd/tree-sitter-comment", rev = "5dd3c62f1bbe378b220fe16b317b85247898639e" } +[[grammar]] +name = "comment" +source = { git = { remote = "https://github.com/stsewd/tree-sitter-comment", rev = "5dd3c62f1bbe378b220fe16b317b85247898639e" } } -[language.wgsl] +[[language]] +name = "wgsl" scope = "source.wgsl" file-types = ["wgsl"] roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } -[grammar.wgsl] -source = { git = "https://github.com/szebniok/tree-sitter-wgsl", rev = "f00ff52251edbd58f4d39c9c3204383253032c11" } +[[grammar]] +name = "wgsl" +source = { git = { remote = "https://github.com/szebniok/tree-sitter-wgsl", rev = "f00ff52251edbd58f4d39c9c3204383253032c11" } } -[language.llvm] +[[language]] +name = "llvm" scope = "source.llvm" roots = [] file-types = ["ll"] @@ -525,10 +611,12 @@ comment-token = ";" indent = { tab-width = 2, unit = " " } injection-regex = "llvm" -[grammar.llvm] -source = { git = "https://github.com/benwilliamgraham/tree-sitter-llvm", rev = "3b213925b9c4f42c1acfe2e10bfbb438d9c6834d" } +[[grammar]] +name = "llvm" +source = { git = { remote = "https://github.com/benwilliamgraham/tree-sitter-llvm", rev = "3b213925b9c4f42c1acfe2e10bfbb438d9c6834d" } } -[language.llvm-mir] +[[language]] +name = "llvm-mir" scope = "source.llvm_mir" roots = [] file-types = [] @@ -536,10 +624,12 @@ comment-token = ";" indent = { tab-width = 2, unit = " " } injection-regex = "mir" -[grammar.llvm-mir] -source = { git = "https://github.com/Flakebi/tree-sitter-llvm-mir", rev = "06fabca19454b2dc00c1b211a7cb7ad0bc2585f1" } +[[grammar]] +name = "llvm-mir" +source = { git = { remote = "https://github.com/Flakebi/tree-sitter-llvm-mir", rev = "06fabca19454b2dc00c1b211a7cb7ad0bc2585f1" } } -[language.llvm-mir-yaml] +[[language]] +name = "llvm-mir-yaml" grammar = "yaml" scope = "source.yaml" roots = [] @@ -547,7 +637,8 @@ file-types = ["mir"] comment-token = "#" indent = { tab-width = 2, unit = " " } -[language.tablegen] +[[language]] +name = "tablegen" scope = "source.tablegen" roots = [] file-types = ["td"] @@ -555,20 +646,24 @@ comment-token = "//" indent = { tab-width = 2, unit = " " } injection-regex = "tablegen" -[grammar.tablegen] -source = { git = "https://github.com/Flakebi/tree-sitter-tablegen", rev = "568dd8a937347175fd58db83d4c4cdaeb6069bd2" } +[[grammar]] +name = "tablegen" +source = { git = { remote = "https://github.com/Flakebi/tree-sitter-tablegen", rev = "568dd8a937347175fd58db83d4c4cdaeb6069bd2" } } -[language.markdown] +[[language]] +name = "markdown" scope = "source.md" injection-regex = "md|markdown" file-types = ["md"] roots = [] indent = { tab-width = 2, unit = " " } -[grammar.markdown] -source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "ad8c32917a16dfbb387d1da567bf0c3fb6fffde2" } +[[grammar]] +name = "markdown" +source = { git = { remote = "https://github.com/MDeiml/tree-sitter-markdown", rev = "ad8c32917a16dfbb387d1da567bf0c3fb6fffde2" } } -[language.dart] +[[language]] +name = "dart" scope = "source.dart" file-types = ["dart"] roots = ["pubspec.yaml"] @@ -577,10 +672,12 @@ comment-token = "//" language-server = { command = "dart", args = ["language-server", "--client-id=helix"] } indent = { tab-width = 2, unit = " " } -[grammar.dart] -source = { git = "https://github.com/UserNobody14/tree-sitter-dart", rev = "6a25376685d1d47968c2cef06d4db8d84a70025e" } +[[grammar]] +name = "dart" +source = { git = { remote = "https://github.com/UserNobody14/tree-sitter-dart", rev = "6a25376685d1d47968c2cef06d4db8d84a70025e" } } -[language.scala] +[[language]] +name = "scala" scope = "source.scala" roots = ["build.sbt", "pom.xml"] file-types = ["scala", "sbt"] @@ -588,10 +685,12 @@ comment-token = "//" indent = { tab-width = 2, unit = " " } language-server = { command = "metals" } -[grammar.scala] -source = { git = "https://github.com/tree-sitter/tree-sitter-scala", rev = "0a3dd53a7fc4b352a538397d054380aaa28be54c" } +[[grammar]] +name = "scala" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-scala", rev = "0a3dd53a7fc4b352a538397d054380aaa28be54c" } } -[language.dockerfile] +[[language]] +name = "dockerfile" scope = "source.dockerfile" injection-regex = "docker|dockerfile" roots = ["Dockerfile"] @@ -600,20 +699,24 @@ comment-token = "#" indent = { tab-width = 2, unit = " " } language-server = { command = "docker-langserver", args = ["--stdio"] } -[grammar.dockerfile] -source = { git = "https://github.com/camdencheek/tree-sitter-dockerfile", rev = "7af32bc04a66ab196f5b9f92ac471f29372ae2ce" } +[[grammar]] +name = "dockerfile" +source = { git = { remote = "https://github.com/camdencheek/tree-sitter-dockerfile", rev = "7af32bc04a66ab196f5b9f92ac471f29372ae2ce" } } -[language.git-commit] +[[language]] +name = "git-commit" scope = "git.commitmsg" roots = [] file-types = ["COMMIT_EDITMSG"] comment-token = "#" indent = { tab-width = 2, unit = " " } -[grammar.git-commit] -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev = "066e395e1107df17183cf3ae4230f1a1406cc972" } +[[grammar]] +name = "git-commit" +source = { git = { remote = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev = "066e395e1107df17183cf3ae4230f1a1406cc972" } } -[language.git-diff] +[[language]] +name = "git-diff" scope = "source.diff" roots = [] file-types = ["diff"] @@ -621,10 +724,12 @@ injection-regex = "diff" comment-token = "#" indent = { tab-width = 2, unit = " " } -[grammar.git-diff] -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-diff", rev = "c12e6ecb54485f764250556ffd7ccb18f8e2942b" } +[[grammar]] +name = "git-diff" +source = { git = { remote = "https://github.com/the-mikedavis/tree-sitter-git-diff", rev = "c12e6ecb54485f764250556ffd7ccb18f8e2942b" } } -[language.git-rebase] +[[language]] +name = "git-rebase" scope = "source.gitrebase" roots = [] file-types = ["git-rebase-todo"] @@ -632,19 +737,23 @@ injection-regex = "git-rebase" comment-token = "#" indent = { tab-width = 2, unit = " " } -[grammar.git-rebase] -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-rebase", rev = "332dc528f27044bc4427024dbb33e6941fc131f2" } +[[grammar]] +name = "git-rebase" +source = { git = { remote = "https://github.com/the-mikedavis/tree-sitter-git-rebase", rev = "332dc528f27044bc4427024dbb33e6941fc131f2" } } -[language.regex] +[[language]] +name = "regex" scope = "source.regex" injection-regex = "regex" file-types = ["regex"] roots = [] -[grammar.regex] -source = { git = "https://github.com/tree-sitter/tree-sitter-regex", rev = "e1cfca3c79896ff79842f057ea13e529b66af636" } +[[grammar]] +name = "regex" +source = { git = { remote = "https://github.com/tree-sitter/tree-sitter-regex", rev = "e1cfca3c79896ff79842f057ea13e529b66af636" } } -[language.git-config] +[[language]] +name = "git-config" scope = "source.gitconfig" roots = [] # TODO: allow specifying file-types as a regex so we can read directory names (e.g. `.git/config`) @@ -653,20 +762,24 @@ injection-regex = "git-config" comment-token = "#" indent = { tab-width = 4, unit = "\t" } -[grammar.git-config] -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-config", rev = "0e4f0baf90b57e5aeb62dcdbf03062c6315d43ea" } +[[grammar]] +name = "git-config" +source = { git = { remote = "https://github.com/the-mikedavis/tree-sitter-git-config", rev = "0e4f0baf90b57e5aeb62dcdbf03062c6315d43ea" } } -[language.graphql] +[[language]] +name = "graphql" scope = "source.graphql" injection-regex = "graphql" file-types = ["gql", "graphql"] roots = [] indent = { tab-width = 2, unit = " " } -[grammar.graphql] -source = { git = "https://github.com/bkegley/tree-sitter-graphql", rev = "5e66e961eee421786bdda8495ed1db045e06b5fe" } +[[grammar]] +name = "graphql" +source = { git = { remote = "https://github.com/bkegley/tree-sitter-graphql", rev = "5e66e961eee421786bdda8495ed1db045e06b5fe" } } -[language.elm] +[[language]] +name = "elm" scope = "source.elm" injection-regex = "elm" file-types = ["elm"] @@ -676,19 +789,23 @@ comment-token = "--" language-server = { command = "elm-language-server" } indent = { tab-width = 4, unit = " " } -[grammar.elm] -source = { git = "https://github.com/elm-tooling/tree-sitter-elm", rev = "bd50ccf66b42c55252ac8efc1086af4ac6bab8cd" } +[[grammar]] +name = "elm" +source = { git = { remote = "https://github.com/elm-tooling/tree-sitter-elm", rev = "bd50ccf66b42c55252ac8efc1086af4ac6bab8cd" } } -[language.iex] +[[language]] +name = "iex" scope = "source.iex" injection-regex = "iex" file-types = ["iex"] roots = [] -[grammar.iex] -source = { git = "https://github.com/elixir-lang/tree-sitter-iex", rev = "39f20bb51f502e32058684e893c0c0b00bb2332c" } +[[grammar]] +name = "iex" +source = { git = { remote = "https://github.com/elixir-lang/tree-sitter-iex", rev = "39f20bb51f502e32058684e893c0c0b00bb2332c" } } -[language.rescript] +[[language]] +name = "rescript" scope = "source.rescript" injection-regex = "rescript" file-types = ["res"] @@ -698,5 +815,6 @@ comment-token = "//" language-server = { command = "rescript-language-server", args = ["--stdio"] } indent = { tab-width = 2, unit = " " } -[grammar.rescript] -source = { git = "https://github.com/jaredramirez/tree-sitter-rescript", rev = "789a171d9bcf73f6d76e67aca39ed14a75375b04" } +[[grammar]] +name = "rescript" +source = { git = { remote = "https://github.com/jaredramirez/tree-sitter-rescript", rev = "789a171d9bcf73f6d76e67aca39ed14a75375b04" } }