mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,80 +1,78 @@
|
|||
((doctest_block) @injection.content
|
||||
(#set! injection.language "python"))
|
||||
|
||||
;; Directives with nested content without arguments nor options
|
||||
(#set! injection.language "python"))
|
||||
; Directives with nested content without arguments nor options
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body) @injection.content)
|
||||
(#set! injection.language "rst")
|
||||
(#any-of?
|
||||
@_type
|
||||
"attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition"
|
||||
"line-block" "parsed-literal" "epigraph" "highlights" "pull-quote" "compound"
|
||||
"header" "footer"
|
||||
"meta"
|
||||
"replace"))
|
||||
name: (type) @_type
|
||||
body: (body) @injection.content)
|
||||
(#set! injection.language "rst")
|
||||
(#any-of? @_type "attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition" "line-block" "parsed-literal" "epigraph" "highlights" "pull-quote" "compound" "header" "footer" "meta" "replace"))
|
||||
|
||||
;; Directives with nested content without arguments, but with options
|
||||
; Directives with nested content without arguments, but with options
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (options) (content) @injection.content))
|
||||
(#set! injection.language "rst")
|
||||
(#any-of?
|
||||
@_type
|
||||
"attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition"
|
||||
"line-block" "parsed-literal" "compound"))
|
||||
name: (type) @_type
|
||||
body:
|
||||
(body
|
||||
(options)
|
||||
(content) @injection.content))
|
||||
(#set! injection.language "rst")
|
||||
(#any-of? @_type "attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition" "line-block" "parsed-literal" "compound"))
|
||||
|
||||
;; Directives with nested content with arguments and options
|
||||
; Directives with nested content with arguments and options
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (content) @injection.content))
|
||||
(#set! injection.language "rst")
|
||||
(#any-of?
|
||||
@_type
|
||||
"figure"
|
||||
"topic" "sidebar" "container"
|
||||
"table" "list-table"
|
||||
"class" "role" "restructuredtext-test-directive"))
|
||||
name: (type) @_type
|
||||
body:
|
||||
(body
|
||||
(content) @injection.content))
|
||||
(#set! injection.language "rst")
|
||||
(#any-of? @_type "figure" "topic" "sidebar" "container" "table" "list-table" "class" "role" "restructuredtext-test-directive"))
|
||||
|
||||
;; Special directives
|
||||
; Special directives
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (arguments) @injection.language (content) @injection.content))
|
||||
(#any-of? @_type "code" "code-block" "sourcecode"))
|
||||
name: (type) @_type
|
||||
body:
|
||||
(body
|
||||
(arguments) @injection.language
|
||||
(content) @injection.content))
|
||||
(#any-of? @_type "code" "code-block" "sourcecode"))
|
||||
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (arguments) @injection.language (content) @injection.content))
|
||||
(#eq? @_type "raw"))
|
||||
name: (type) @_type
|
||||
body:
|
||||
(body
|
||||
(arguments) @injection.language
|
||||
(content) @injection.content))
|
||||
(#eq? @_type "raw"))
|
||||
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (content) @injection.content))
|
||||
(#set! injection.language "latex")
|
||||
(#eq? @_type "math"))
|
||||
name: (type) @_type
|
||||
body:
|
||||
(body
|
||||
(content) @injection.content))
|
||||
(#set! injection.language "latex")
|
||||
(#eq? @_type "math"))
|
||||
|
||||
; TODO: re-add when a parser for csv is added.
|
||||
((directive
|
||||
name: (type) @_type
|
||||
body: (body (content) @injection.content))
|
||||
(#set! injection.language "csv")
|
||||
(#eq? @_type "csv-table"))
|
||||
|
||||
;; Special roles - prefix
|
||||
name: (type) @_type
|
||||
body:
|
||||
(body
|
||||
(content) @injection.content))
|
||||
(#set! injection.language "csv")
|
||||
(#eq? @_type "csv-table"))
|
||||
|
||||
; Special roles - prefix
|
||||
((interpreted_text
|
||||
(role) @_role
|
||||
"interpreted_text" @injection.content)
|
||||
(#eq? @_role ":math:")
|
||||
(#set! injection.language "latex"))
|
||||
|
||||
;; Special roles - suffix
|
||||
(#eq? @_role ":math:")
|
||||
(#set! injection.language "latex"))
|
||||
|
||||
; Special roles - suffix
|
||||
((interpreted_text
|
||||
"interpreted_text" @injection.content
|
||||
(role) @_role)
|
||||
(#eq? @_role ":math:")
|
||||
(#set! injection.language "latex"))
|
||||
(#eq? @_role ":math:")
|
||||
(#set! injection.language "latex"))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
(#set! injection.language "comment"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue