add tests and queries
This commit is contained in:
+145
-14
@@ -1,29 +1,160 @@
|
||||
; Identifiers
|
||||
|
||||
(cycle name:
|
||||
name: (identifier) @variable)
|
||||
(identifier) @variable
|
||||
|
||||
variable: (identifier) @variable.parameter
|
||||
|
||||
|
||||
(block_group
|
||||
name: (push_block) @block_name)
|
||||
(push_block) @type)
|
||||
|
||||
(partialdef_group
|
||||
name: (push_partial) @partial_name)
|
||||
(push_partial) @type)
|
||||
|
||||
(verbatim_group
|
||||
name: (push_verbatim) @verbatim_name)
|
||||
(push_verbatim) @type)
|
||||
|
||||
(with_group
|
||||
variables: (_
|
||||
name: (identifier) @variable))
|
||||
(comment_content) @comment
|
||||
(template_comment) @comment
|
||||
(attribute) @attribute
|
||||
|
||||
; Literals
|
||||
[
|
||||
(binaryOperator)
|
||||
("is")
|
||||
("not")
|
||||
("as")
|
||||
("in")
|
||||
("=")
|
||||
("|")
|
||||
(".")] @operator
|
||||
|
||||
[
|
||||
("{{")
|
||||
("{#")
|
||||
("{%")
|
||||
("}}")
|
||||
("#}")
|
||||
("%}")
|
||||
(",")] @punctuation
|
||||
|
||||
(number) @number
|
||||
(string) @string
|
||||
|
||||
; Constants
|
||||
(library
|
||||
(identifier) @module)
|
||||
|
||||
(template_block_groups
|
||||
tag: (_) @tag)
|
||||
tag: [
|
||||
("autoescape")
|
||||
("endautoescape")
|
||||
("block")
|
||||
("endblock")
|
||||
("comment")
|
||||
("endcomment")
|
||||
("csrf_token")
|
||||
("cycle")
|
||||
("debug")
|
||||
("extends")
|
||||
("filter")
|
||||
("endfilter")
|
||||
("firstof")
|
||||
("for")
|
||||
("empty")
|
||||
("endfor")
|
||||
("for")
|
||||
("empty")
|
||||
("endfor")
|
||||
("if")
|
||||
("elif")
|
||||
("else")
|
||||
("endif")
|
||||
("ifchanged")
|
||||
("endifchanged")
|
||||
("include")
|
||||
("lorem")
|
||||
("load")
|
||||
("now")
|
||||
("partial")
|
||||
("partialdef")
|
||||
("endpartialdef")
|
||||
("querystring")
|
||||
("regroup")
|
||||
("resetcycle")
|
||||
("spaceless")
|
||||
("endspaceless")
|
||||
("templatetag")
|
||||
("url")
|
||||
("verbatim")
|
||||
("endverbatim")
|
||||
("with")
|
||||
("endwith")] @function
|
||||
|
||||
(filter . (_) @filter)
|
||||
(filter .
|
||||
[
|
||||
("add:")
|
||||
("addslashes")
|
||||
("capfirst")
|
||||
("center:")
|
||||
("cut:")
|
||||
("date")
|
||||
("date:")
|
||||
("default:")
|
||||
("default_if_none:")
|
||||
("dictsort:")
|
||||
("dictsortreversed:")
|
||||
("divisibleby:")
|
||||
("escape")
|
||||
("escapejs")
|
||||
("filesizeformat")
|
||||
("first")
|
||||
("floatformat")
|
||||
("floatformat:")
|
||||
("force_escape")
|
||||
("get_digit:")
|
||||
("iriencode")
|
||||
("join:")
|
||||
("json_script")
|
||||
("json_script:")
|
||||
("last")
|
||||
("length")
|
||||
("length_is:")
|
||||
("linebreaks")
|
||||
("linebreaksbr")
|
||||
("linenumbers")
|
||||
("ljust:")
|
||||
("lower")
|
||||
("make_list")
|
||||
("phone2numeric")
|
||||
("pluralize")
|
||||
("pluralize:")
|
||||
("pprint")
|
||||
("random")
|
||||
("rjust:")
|
||||
("safe")
|
||||
("safeseq")
|
||||
("slice:")
|
||||
("slugify")
|
||||
("stringformat:")
|
||||
("striptags")
|
||||
("time")
|
||||
("time:")
|
||||
("timesince")
|
||||
("timesince:")
|
||||
("timeuntil")
|
||||
("timeuntil:")
|
||||
("title")
|
||||
("truncatechars:")
|
||||
("truncatechars_html:")
|
||||
("truncatewords:")
|
||||
("truncatewords_html:")
|
||||
("unordered_list")
|
||||
("upper")
|
||||
("urlencode")
|
||||
("urlencode:")
|
||||
("urlize")
|
||||
("urlizetrunc:")
|
||||
("wordcount")
|
||||
("wordwrap:")
|
||||
("yesno")
|
||||
("yesno:")] @function)
|
||||
|
||||
(load
|
||||
(identifier) @function)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
[(content) (verbatim_content)] @injection.content @injection.combined
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
(identifier) @local.reference
|
||||
|
||||
variable: (identifier) @local.definition
|
||||
|
||||
(with_group) @local.scope
|
||||
(for_scope) @local.scope
|
||||
@@ -0,0 +1,15 @@
|
||||
(load
|
||||
(identifier) @name) @definition.function
|
||||
|
||||
(partialdef_group (push_partial) @name) @definition.method
|
||||
(partial (identifier) @name) @reference.call
|
||||
|
||||
(template_block_groups
|
||||
[
|
||||
(_
|
||||
tag: _ @name) @reference.call
|
||||
(for_group
|
||||
(for_scope
|
||||
tag: "for" @reference.call))])
|
||||
|
||||
(filter) @reference.call
|
||||
Reference in New Issue
Block a user