add tree-sitter-git-config (#1426)

* add tree-sitter-git-config

* add todo comment for improving filetype check
imgbot
Michael Davis 2 years ago committed by GitHub
parent 97e12f5c5a
commit e0a99ae51a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

4
.gitmodules vendored

@ -198,3 +198,7 @@
path = helix-syntax/languages/tree-sitter-make
url = https://github.com/alemuller/tree-sitter-make
shallow = true
[submodule "helix-syntax/languages/tree-sitter-git-config"]
path = helix-syntax/languages/tree-sitter-git-config
url = https://github.com/the-mikedavis/tree-sitter-git-config.git
shallow = true

@ -12,6 +12,7 @@
| elixir | ✓ | | | `elixir-ls` |
| fish | ✓ | ✓ | ✓ | |
| git-commit | ✓ | | | |
| git-config | ✓ | | | |
| git-diff | ✓ | | | |
| git-rebase | ✓ | | | |
| glsl | ✓ | | ✓ | |

@ -0,0 +1 @@
Subproject commit 0e4f0baf90b57e5aeb62dcdbf03062c6315d43ea

@ -545,3 +545,13 @@ scope = "source.regex"
injection-regex = "regex"
file-types = ["regex"]
roots = []
[[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`)
file-types = [".gitmodules", ".gitconfig"]
injection-regex = "git-config"
comment-token = "#"
indent = { tab-width = 4, unit = "\t" }

@ -0,0 +1,27 @@
((section_name) @keyword.directive
(#eq? @keyword.directive "include"))
((section_header
(section_name) @keyword.directive
(subsection_name))
(#eq? @keyword.directive "includeIf"))
(section_name) @markup.heading
(variable (name) @variable.other.member)
[(true) (false)] @constant.builtin.boolean
(integer) @constant.numeric.integer
((string) @string.special.path
(#match? @string.special.path "^(~|./|/)"))
[(string) (subsection_name)] @string
[
"["
"]"
"\""
] @punctuation.bracket
"=" @punctuation.delimiter
(comment) @comment
Loading…
Cancel
Save