mirror of https://github.com/helix-editor/helix
Add tree-sitter injections for jj config files (#13926)
parent
ab668c2dfc
commit
3658e97c2b
|
@ -117,7 +117,10 @@
|
|||
| java | ✓ | ✓ | ✓ | `jdtls` |
|
||||
| javascript | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| jinja | ✓ | | | |
|
||||
| jjconfig | ✓ | ✓ | ✓ | `taplo`, `tombi` |
|
||||
| jjdescription | ✓ | | | |
|
||||
| jjrevset | ✓ | | | |
|
||||
| jjtemplate | ✓ | | | |
|
||||
| jq | ✓ | ✓ | | `jq-lsp` |
|
||||
| jsdoc | ✓ | | | |
|
||||
| json | ✓ | ✓ | ✓ | `vscode-json-language-server` |
|
||||
|
|
|
@ -3541,6 +3541,16 @@ block-comment-tokens = { start = "{#", end = "#}" }
|
|||
name = "jinja2"
|
||||
source = { git = "https://github.com/varpeti/tree-sitter-jinja2", rev = "a533cd3c33aea6acb0f9bf9a56f35dcfe6a8eb53" }
|
||||
|
||||
[[language]]
|
||||
name = "jjconfig"
|
||||
scope = "source.jjconfig"
|
||||
injection-regex = "jjconfig"
|
||||
grammar = "toml"
|
||||
file-types = [{ glob = "jj/config.toml" }, { glob = "jj/conf.d/*.toml" }, { glob = ".jj/repo/*.toml" }]
|
||||
comment-token = "#"
|
||||
language-servers = [ "taplo", "tombi" ]
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "jjdescription"
|
||||
scope = "jj.description"
|
||||
|
@ -3554,6 +3564,24 @@ text-width = 72
|
|||
name = "jjdescription"
|
||||
source = { git = "https://github.com/kareigu/tree-sitter-jjdescription", rev = "1613b8c85b6ead48464d73668f39910dcbb41911" }
|
||||
|
||||
[[language]]
|
||||
name = "jjrevset"
|
||||
scope = "jj.revset"
|
||||
file-types = ["jjrevset"]
|
||||
|
||||
[[grammar]]
|
||||
name = "jjrevset"
|
||||
source = { git = "https://github.com/bryceberger/tree-sitter-jjrevset", rev = "d9af23944b884ec528b505f41d81923bb3136a51" }
|
||||
|
||||
[[language]]
|
||||
name = "jjtemplate"
|
||||
scope = "jj.template"
|
||||
file-types = ["jjtemplate"]
|
||||
|
||||
[[grammar]]
|
||||
name = "jjtemplate"
|
||||
source = { git = "https://github.com/bryceberger/tree-sitter-jjtemplate", rev = "4313eda8ac31c60e550e3ad5841b100a0a686715" }
|
||||
|
||||
[[language]]
|
||||
name = "jq"
|
||||
scope = "source.jq"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
; inherits: toml
|
|
@ -0,0 +1 @@
|
|||
; inherits: toml
|
|
@ -0,0 +1,10 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
(table
|
||||
(bare_key) @table-name (#any-of? @table-name "templates" "template-aliases")
|
||||
[(pair (_) ((string) @injection.content (#set! injection.language "jjtemplate"))) (comment)]*)
|
||||
|
||||
(table
|
||||
(bare_key) @table-name (#any-of? @table-name "revsets" "revset-aliases")
|
||||
[(pair (_) ((string) @injection.content (#set! injection.language "jjrevset"))) (comment)]*)
|
|
@ -0,0 +1 @@
|
|||
; inherits: toml
|
|
@ -0,0 +1,18 @@
|
|||
(at_op) @variable.builtin
|
||||
|
||||
[
|
||||
"::" ".."
|
||||
(negate_op)
|
||||
(union_op) (intersection_op) (difference_op)
|
||||
] @operator
|
||||
|
||||
["(" ")"] @punctuation.bracket
|
||||
"," @punctuation.delimiter
|
||||
[(raw_string_literal) (string_literal)] @string
|
||||
|
||||
(function ((strict_identifier) @function))
|
||||
(function (function_arguments (keyword_argument (strict_identifier) @variable.parameter)))
|
||||
|
||||
(primary ((identifier) @variable))
|
||||
|
||||
(string_pattern (strict_identifier) @keyword)
|
|
@ -0,0 +1,14 @@
|
|||
(function ((identifier) @function))
|
||||
; method calls
|
||||
(term (_) ("." @punctuation) ((function ((identifier) @function.method))))
|
||||
|
||||
["(" ")"] @punctuation.bracket
|
||||
"," @punctuation.delimiter
|
||||
|
||||
((identifier) @keyword.control.conditional (#eq? @keyword.control.conditional "if"))
|
||||
((identifier) @keyword.control.repeat (#eq? @keyword.control.repeat "for"))
|
||||
|
||||
(term ((identifier) @variable))
|
||||
|
||||
[(infix_ops) "++"] @operator
|
||||
[(string_literal) (raw_string_literal)] @string
|
Loading…
Reference in New Issue