on master help sign in
Update tree-sitter-git-rebase (#6030)
commit71220da1392e373f1f7dc6370def9cd3c5c41ff9 authorSkyler Hawthorne <skyler@dead10ck.com> dateSun 19 Feb 2023, 12:34 (4 years ago) parentc5c1b5a
2 files changed+38−12
runtime/queries/git-rebase/highlights.scm+33−8 runtime/queries/git-rebase/injections.scm+5−4
runtime/queries/git-rebase/highlights.scm+33−8
@@ -1,11 +1,36 @@
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)
1+; a rough translation:
2+; * constant.builtin - git hash
3+; * constant - a git label
4+; * keyword - command that acts on commits commits
5+; * function - command that acts only on labels
6+; * comment - discarded commentary on a command, has no effect on the rebase
7+; * string - text used in the rebase operation
8+; * operator - a 'switch' (used in fixup and merge), either -c or -C at time of writing
9+
10+(((command) @keyword
11+ (label) @constant.builtin
12+ (message)? @comment)
13+ (#match? @keyword "^(p|pick|r|reword|e|edit|s|squash|d|drop)$"))
14+
15+(((command) @function
16+ (label) @constant
17+ (message)? @comment)
18+ (#match? @function "^(l|label|t|reset|u|update-ref)$"))
19+
20+((command) @keyword
21+ (#match? @keyword "^(x|exec|b|break)$"))
22+
23+(((command) @attribute
24+ (label) @constant.builtin
25+ (message)? @comment)
26+ (#match? @attribute "^(f|fixup)$"))
27+
28+(((command) @keyword
29+ (label) @constant.builtin
30+ (label) @constant
31+ (message) @string)
32+ (#match? @keyword "^(m|merge)$"))
433
534(option) @operator
6−(label) @string.special.symbol
7−(commit) @constant
8−"#" @punctuation.delimiter
9−(comment) @comment
1035
11−(ERROR) @error
36+(comment) @comment
runtime/queries/git-rebase/injections.scm+5−4
@@ -1,4 +1,5 @@
1−((operation
2− operator: ["x" "exec"]
3− (command) @injection.content)
4− (#set! injection.language "bash"))
1+(((command) @attribute
2+ (message)? @injection.content)
3+ (#match? @attribute "^(x|exec)$")
4+ (#set! injection.language "bash")
5+)