mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
add tree-sitter-git-config (#1426)
* add tree-sitter-git-config * add todo comment for improving filetype check
This commit is contained in:
parent
97e12f5c5a
commit
e0a99ae51a
4
.gitmodules
vendored
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 | ✓ | | ✓ | |
|
||||
|
1
helix-syntax/languages/tree-sitter-git-config
Submodule
1
helix-syntax/languages/tree-sitter-git-config
Submodule
@ -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" }
|
||||
|
27
runtime/queries/git-config/highlights.scm
Normal file
27
runtime/queries/git-config/highlights.scm
Normal file
@ -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…
Reference in New Issue
Block a user