on master help sign in
add tree-sitter-git-rebase (#1402)
8fda87aMichael Davis
.gitmodules+4
@@ -178,3 +178,7 @@
178 path = helix-syntax/languages/tree-sitter-git-diff
178 path = helix-syntax/languages/tree-sitter-git-diff
179 url = https://github.com/the-mikedavis/tree-sitter-git-diff.git
179 url = https://github.com/the-mikedavis/tree-sitter-git-diff.git
180 shallow = true
180 shallow = true
181+[submodule "helix-syntax/languages/tree-sitter-git-rebase"]
182+ path = helix-syntax/languages/tree-sitter-git-rebase
183+ url = https://github.com/the-mikedavis/tree-sitter-git-rebase.git
184+ shallow = true
book/src/generated/lang-support.md+1
@@ -13,6 +13,7 @@
13| fish | ✓ | ✓ | ✓ | |
13| fish | ✓ | ✓ | ✓ | |
14| git-commit | ✓ | | | |
14| git-commit | ✓ | | | |
15| git-diff | ✓ | | | |
15| git-diff | ✓ | | | |
16+| git-rebase | ✓ | | | |
16| glsl | ✓ | | ✓ | |
17| glsl | ✓ | | ✓ | |
17| go | ✓ | ✓ | ✓ | `gopls` |
18| go | ✓ | ✓ | ✓ | `gopls` |
18| html | ✓ | | | |
19| html | ✓ | | | |
helix-syntax/languages/tree-sitter-git-rebasenew file+1

Submodule changed.

languages.toml+9
@@ -490,3 +490,12 @@ file-types = ["diff"]
490injection-regex = "diff"
490injection-regex = "diff"
491comment-token = "#"
491comment-token = "#"
492indent = { tab-width = 2, unit = " " }
492indent = { tab-width = 2, unit = " " }
493+
494+[[language]]
495+name = "git-rebase"
496+scope = "source.gitrebase"
497+roots = []
498+file-types = ["git-rebase-todo"]
499+injection-regex = "git-rebase"
500+comment-token = "#"
501+indent = { tab-width = 2, unit = " " }
runtime/queries/git-commit/highlights.scm−1
@@ -4,7 +4,6 @@
4(commit) @constant
4(commit) @constant
5(item) @markup.link.url
5(item) @markup.link.url
6(header) @tag
6(header) @tag
7−(rebase_command) @markup.raw
8
7
9(change kind: "new file" @diff.plus)
8(change kind: "new file" @diff.plus)
10(change kind: "deleted" @diff.minus)
9(change kind: "deleted" @diff.minus)
runtime/queries/git-commit/injections.scm+3−5
@@ -3,8 +3,6 @@
3 (#set! injection.include-children)
3 (#set! injection.include-children)
4 (#set! injection.language "diff"))
4 (#set! injection.language "diff"))
5
5
6−; once a rebase grammar is available, we can inject rebase highlighting into
7−; interactive rebase summary sections like so:
8−;
9−; ((rebase_command) @injection.content
6+((rebase_command) @injection.content
7+ (#set! injection.include-children)
10−; (#set! injection.language "git-rebase"))
8+ (#set! injection.language "git-rebase"))
runtime/queries/git-rebase/highlights.scmnew file+11
@@ -0,0 +1,11 @@
1+(operation operator: ["p" "pick" "r" "reword" "e" "edit" "s" "squash" "m" "merge" "d" "drop" "b" "break" "x" "exec"] @keyword)
2+(operation operator: ["l" "label" "t" "reset"] @function)
3+(operation operator: ["f" "fixup"] @function.special)
4+
5+(option) @operator
6+(label) @string.special.symbol
7+(commit) @constant
8+"#" @punctuation.delimiter
9+(comment) @comment
10+
11+(ERROR) @error
runtime/queries/git-rebase/injections.scmnew file+4
@@ -0,0 +1,4 @@
1+((operation
2+ operator: ["x" "exec"]
3+ (command) @injection.content)
4+ (#set! injection.language "bash"))