Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
b7b36780b5
5 changed files with 65 additions and 42 deletions
|
@ -217,7 +217,7 @@
|
|||
| thrift | ✓ | | | |
|
||||
| todotxt | ✓ | | | |
|
||||
| toml | ✓ | ✓ | | `taplo` |
|
||||
| tsq | ✓ | | | |
|
||||
| tsq | ✓ | | | `ts_query_ls` |
|
||||
| tsx | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| twig | ✓ | | | |
|
||||
| typescript | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
|
|
|
@ -122,6 +122,7 @@ zls = { command = "zls" }
|
|||
blueprint-compiler = { command = "blueprint-compiler", args = ["lsp"] }
|
||||
typst-lsp = { command = "typst-lsp" }
|
||||
tinymist = { command = "tinymist" }
|
||||
ts_query_ls = { command = "ts_query_ls" }
|
||||
pkgbuild-language-server = { command = "pkgbuild-language-server" }
|
||||
helm_ls = { command = "helm_ls", args = ["serve"] }
|
||||
ember-language-server = { command = "ember-language-server", args = ["--stdio"] }
|
||||
|
@ -1458,14 +1459,21 @@ language-servers = [ "swipl" ]
|
|||
[[language]]
|
||||
name = "tsq"
|
||||
scope = "source.tsq"
|
||||
file-types = ["tsq"]
|
||||
file-types = [{ glob = "queries/*.scm" }, { glob = "injections.scm" }, { glob = "highlights.scm" }, { glob = "indents.scm" }, { glob = "textobjects.scm" }, { glob = "locals.scm" }, { glob = "tags.scm" }]
|
||||
comment-token = ";"
|
||||
injection-regex = "tsq"
|
||||
language-servers = ["ts_query_ls"]
|
||||
grammar = "query"
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[language.auto-pairs]
|
||||
'(' = ')'
|
||||
'[' = ']'
|
||||
'"' = '"'
|
||||
|
||||
[[grammar]]
|
||||
name = "tsq"
|
||||
source = { git = "https://github.com/the-mikedavis/tree-sitter-tsq", rev = "48b5e9f82ae0a4727201626f33a17f69f8e0ff86" }
|
||||
name = "query"
|
||||
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-query", rev = "a6674e279b14958625d7a530cabe06119c7a1532" }
|
||||
|
||||
[[language]]
|
||||
name = "cmake"
|
||||
|
|
6
runtime/queries/tsq/folds.scm
Normal file
6
runtime/queries/tsq/folds.scm
Normal file
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
(named_node)
|
||||
(predicate)
|
||||
(grouping)
|
||||
(list)
|
||||
] @fold
|
|
@ -1,50 +1,57 @@
|
|||
; mark the string passed #match? as a regex
|
||||
(((predicate_name) @function
|
||||
(capture)
|
||||
(string) @string.regexp)
|
||||
(#eq? @function "#match?"))
|
||||
((program
|
||||
.
|
||||
(comment)*
|
||||
.
|
||||
(comment) @keyword.import)
|
||||
(#match? @keyword.import "^;+ *inherits *:"))
|
||||
|
||||
; highlight inheritance comments
|
||||
(((comment) @keyword.directive)
|
||||
(#match? @keyword.directive "^; +inherits *:"))
|
||||
((parameters
|
||||
(identifier) @constant.numeric)
|
||||
(#match? @constant.numeric "^[-+]?[0-9]+(.[0-9]+)?$"))
|
||||
|
||||
"_" @constant
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
"@"
|
||||
"#"
|
||||
] @punctuation.special
|
||||
|
||||
":" @punctuation.delimiter
|
||||
"!" @operator
|
||||
|
||||
[
|
||||
(one_or_more)
|
||||
(zero_or_one)
|
||||
(zero_or_more)
|
||||
] @operator
|
||||
"["
|
||||
"]"
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
(wildcard_node)
|
||||
(anchor)
|
||||
] @constant.builtin
|
||||
"." @operator
|
||||
|
||||
[
|
||||
(anonymous_leaf)
|
||||
(string)
|
||||
] @string
|
||||
(predicate_type) @punctuation.special
|
||||
|
||||
(quantifier) @operator
|
||||
|
||||
(comment) @comment
|
||||
|
||||
(field_name) @variable.other.member
|
||||
(negated_field
|
||||
"!" @operator
|
||||
(identifier) @variable.other.member)
|
||||
|
||||
(capture) @label
|
||||
(field_definition
|
||||
name: (identifier) @variable.other.member)
|
||||
|
||||
((predicate_name) @function
|
||||
(#any-of? @function "#eq?" "#match?" "#any-of?" "#not-any-of?" "#is?" "#is-not?" "#not-same-line?" "#not-kind-eq?" "#set!" "#select-adjacent!" "#strip!"))
|
||||
(predicate_name) @error
|
||||
(named_node
|
||||
name: (identifier) @variable)
|
||||
|
||||
(predicate
|
||||
name: (identifier) @function)
|
||||
|
||||
(anonymous_node
|
||||
(string) @string)
|
||||
|
||||
(capture
|
||||
(identifier) @type)
|
||||
|
||||
(escape_sequence) @constant.character.escape
|
||||
|
||||
(node_name) @tag
|
||||
(variable) @variable
|
||||
(string) @string
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((predicate
|
||||
(predicate_name) @_predicate
|
||||
(string) @injection.content)
|
||||
(#eq? @_predicate "#match?")
|
||||
(#set! injection.language "regex"))
|
||||
name: (identifier) @_name
|
||||
parameters:
|
||||
(parameters
|
||||
(string) @injection.content))
|
||||
(#any-of? @_name "match" "not-match")
|
||||
(#set! injection.language "regex"))
|
||||
|
|
Loading…
Add table
Reference in a new issue