mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-08-17 03:50:21 +03:00
add tree-sitter-git-rebase (#1402)
* add submodule on tree-sitter-rebase, add to languages * add basic highlights query * inject bash in execute statements * update tree-sitter-rebase * tree-sitter-rebase->tree-sitter-git-rebase * get injection working with tree-sitter-git-commit * set scope under source.gitrebase * unset include-children on commit message injections * Revert "unset include-children on commit message injections" This reverts commit 2ecee155ea8e229651920b291062c2ee84b47944. * fix generated language docs * use rebase_command scopes from tree-sitter-git-commit
This commit is contained in:
parent
a066f59dc8
commit
8fda87af2b
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -178,3 +178,7 @@
|
||||
path = helix-syntax/languages/tree-sitter-git-diff
|
||||
url = https://github.com/the-mikedavis/tree-sitter-git-diff.git
|
||||
shallow = true
|
||||
[submodule "helix-syntax/languages/tree-sitter-git-rebase"]
|
||||
path = helix-syntax/languages/tree-sitter-git-rebase
|
||||
url = https://github.com/the-mikedavis/tree-sitter-git-rebase.git
|
||||
shallow = true
|
||||
|
@ -13,6 +13,7 @@
|
||||
| fish | ✓ | ✓ | ✓ | |
|
||||
| git-commit | ✓ | | | |
|
||||
| git-diff | ✓ | | | |
|
||||
| git-rebase | ✓ | | | |
|
||||
| glsl | ✓ | | ✓ | |
|
||||
| go | ✓ | ✓ | ✓ | `gopls` |
|
||||
| html | ✓ | | | |
|
||||
|
1
helix-syntax/languages/tree-sitter-git-rebase
Submodule
1
helix-syntax/languages/tree-sitter-git-rebase
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 332dc528f27044bc4427024dbb33e6941fc131f2
|
@ -490,3 +490,12 @@ file-types = ["diff"]
|
||||
injection-regex = "diff"
|
||||
comment-token = "#"
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "git-rebase"
|
||||
scope = "source.gitrebase"
|
||||
roots = []
|
||||
file-types = ["git-rebase-todo"]
|
||||
injection-regex = "git-rebase"
|
||||
comment-token = "#"
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
@ -4,7 +4,6 @@
|
||||
(commit) @constant
|
||||
(item) @markup.link.url
|
||||
(header) @tag
|
||||
(rebase_command) @markup.raw
|
||||
|
||||
(change kind: "new file" @diff.plus)
|
||||
(change kind: "deleted" @diff.minus)
|
||||
|
@ -3,8 +3,6 @@
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "diff"))
|
||||
|
||||
; once a rebase grammar is available, we can inject rebase highlighting into
|
||||
; interactive rebase summary sections like so:
|
||||
;
|
||||
; ((rebase_command) @injection.content
|
||||
; (#set! injection.language "git-rebase"))
|
||||
((rebase_command) @injection.content
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "git-rebase"))
|
||||
|
11
runtime/queries/git-rebase/highlights.scm
Normal file
11
runtime/queries/git-rebase/highlights.scm
Normal file
@ -0,0 +1,11 @@
|
||||
(operation operator: ["p" "pick" "r" "reword" "e" "edit" "s" "squash" "m" "merge" "d" "drop" "b" "break" "x" "exec"] @keyword)
|
||||
(operation operator: ["l" "label" "t" "reset"] @function)
|
||||
(operation operator: ["f" "fixup"] @function.special)
|
||||
|
||||
(option) @operator
|
||||
(label) @string.special.symbol
|
||||
(commit) @constant
|
||||
"#" @punctuation.delimiter
|
||||
(comment) @comment
|
||||
|
||||
(ERROR) @error
|
4
runtime/queries/git-rebase/injections.scm
Normal file
4
runtime/queries/git-rebase/injections.scm
Normal file
@ -0,0 +1,4 @@
|
||||
((operation
|
||||
operator: ["x" "exec"]
|
||||
(command) @injection.content)
|
||||
(#set! injection.language "bash"))
|
Loading…
Reference in New Issue
Block a user