diff --git a/README.md b/README.md index ed5736bd2..89267d626 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod) - [x] [gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) (maintained by @ObserverOfTime) - [x] [gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) (maintained by @gbprod) +- [x] [gitconfig](https://github.com/the-mikedavis/tree-sitter-git-config) (maintained by @amaanq) - [x] [gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) (maintained by @theHamsta) - [x] [gleam](https://github.com/gleam-lang/tree-sitter-gleam) (maintained by @amaanq) - [x] [Glimmer and Ember](https://github.com/alexlafroscia/tree-sitter-glimmer) (maintained by @NullVoxPopuli) diff --git a/lockfile.json b/lockfile.json index ff5dbd483..99fbb2205 100644 --- a/lockfile.json +++ b/lockfile.json @@ -149,6 +149,9 @@ "gitcommit": { "revision": "f71b93f399c9c2b315825827c95466e7405ec622" }, + "git_config": { + "revision": "a01b498b25003d97a5f93b0da0e6f28307454347" + }, "gitignore": { "revision": "f4685bf11ac466dd278449bcfe5fd014e94aa504" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 235e2a094..e36d6cdec 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -516,6 +516,16 @@ list.gitcommit = { maintainers = { "@gbprod" }, } +list.git_config = { + install_info = { + url = "https://github.com/the-mikedavis/tree-sitter-git-config", + files = { "src/parser.c" }, + }, + filetype = "gitconfig", + maintainers = { "@amaanq" }, + readme_name = "gitconfig", +} + list.gitignore = { install_info = { url = "https://github.com/shunsambongi/tree-sitter-gitignore", diff --git a/queries/git_config/folds.scm b/queries/git_config/folds.scm new file mode 100644 index 000000000..e69de29bb diff --git a/queries/git_config/highlights.scm b/queries/git_config/highlights.scm new file mode 100644 index 000000000..9172e890c --- /dev/null +++ b/queries/git_config/highlights.scm @@ -0,0 +1,46 @@ +; Sections + +(section_name) @type + +((section_name) @include + (#eq? @include "include")) + +((section_header + (section_name) @include + (subsection_name)) + (#eq? @include "includeIf")) + +(variable (name) @property) + +; Operators + +[ + "=" +] @operator + +; Literals + +(integer) @number +[ + (true) + (false) +] @boolean + +(string) @string + +((string) @text.uri + (#match? @text.uri "^(~|./|/)")) + +(section_header + [ + "\"" + (subsection_name) + ] @string.special) + +; Punctuation + +[ "[" "]" ] @punctuation.bracket + +; Comments + +(comment) @comment @spell