mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 02:40:09 -04:00
feat(format-scripts): linewrap predicates
"format-ignore".kick()
This commit is contained in:
parent
a29058fe8b
commit
31641d72a4
57 changed files with 1622 additions and 1537 deletions
|
|
@ -30,20 +30,15 @@
|
|||
name: (type) @keyword.import)
|
||||
(#eq? @keyword.import "include"))
|
||||
|
||||
((directive
|
||||
name: (type) @function.builtin)
|
||||
; format-ignore
|
||||
(directive
|
||||
name: (type) @function.builtin
|
||||
(#any-of? @function.builtin
|
||||
; https://docutils.sourceforge.io/docs/ref/rst/directives.html
|
||||
"attention" "caution" "danger" "error" "hint" "important" "note" "tip" "warning" "admonition"
|
||||
"image" "figure"
|
||||
"topic" "sidebar" "line-block" "parsed-literal" "code" "math" "rubric" "epigraph" "highlights" "pull-quote" "compound" "container"
|
||||
"table" "csv-table" "list-table"
|
||||
"contents" "sectnum" "section-numbering" "header" "footer"
|
||||
"target-notes"
|
||||
"meta"
|
||||
"replace" "unicode" "date"
|
||||
"raw" "class" "role" "default-role" "title" "restructuredtext-test-directive"))
|
||||
"image" "figure" "topic" "sidebar" "line-block" "parsed-literal" "code" "math" "rubric"
|
||||
"epigraph" "highlights" "pull-quote" "compound" "container" "table" "csv-table" "list-table"
|
||||
"contents" "sectnum" "section-numbering" "header" "footer" "target-notes" "meta" "replace"
|
||||
"unicode" "date" "raw" "class" "role" "default-role" "title" "restructuredtext-test-directive"))
|
||||
|
||||
; Blocks
|
||||
[
|
||||
|
|
@ -87,25 +82,10 @@
|
|||
(role) @function
|
||||
|
||||
((role) @function.builtin
|
||||
; format-ignore
|
||||
(#any-of? @function.builtin
|
||||
; https://docutils.sourceforge.io/docs/ref/rst/roles.html
|
||||
":emphasis:"
|
||||
":literal:"
|
||||
":code:"
|
||||
":math:"
|
||||
":pep-reference:"
|
||||
":PEP:"
|
||||
":rfc-reference:"
|
||||
":RFC:"
|
||||
":strong:"
|
||||
":subscript:"
|
||||
":sub:"
|
||||
":superscript:"
|
||||
":sup:"
|
||||
":title-reference:"
|
||||
":title:"
|
||||
":t:"
|
||||
":emphasis:" ":literal:" ":code:" ":math:" ":pep-reference:" ":PEP:" ":rfc-reference:" ":RFC:"
|
||||
":strong:" ":subscript:" ":sub:" ":superscript:" ":sup:" ":title-reference:" ":title:" ":t:"
|
||||
":raw:"))
|
||||
|
||||
[
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@
|
|||
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"))
|
||||
(#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
|
||||
((directive
|
||||
|
|
@ -16,7 +19,9 @@
|
|||
(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"))
|
||||
(#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
|
||||
((directive
|
||||
|
|
@ -25,7 +30,9 @@
|
|||
(body
|
||||
(content) @injection.content))
|
||||
(#set! injection.language "rst")
|
||||
(#any-of? @_type "figure" "topic" "sidebar" "container" "table" "list-table" "class" "role" "restructuredtext-test-directive"))
|
||||
(#any-of? @_type
|
||||
"figure" "topic" "sidebar" "container" "table" "list-table" "class" "role"
|
||||
"restructuredtext-test-directive"))
|
||||
|
||||
; Special directives
|
||||
((directive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue