nvim-treesitter/queries/python/injections.scm
Santos Gallegos 4a7a713c52
Comment: use @combined to create just one tree per buffer (#1252)
* Comment: use `@combined` to create just one tree per buffer

There is no need to create a tree per line/block for comments.
Should fix https://github.com/nvim-treesitter/nvim-treesitter/issues/1251

* Add injections for scss

* Fix jsonc

* Combine jsdoc
2021-04-28 07:19:07 -05:00

26 lines
659 B
Scheme

((call
function: (attribute
object: (identifier) @_re)
arguments: (argument_list (string) @regex))
(#eq? @_re "re")
(#match? @regex "^r.*"))
; Module docstring
((module . (expression_statement (string) @rst))
(#offset! @rst 0 3 0 -3))
; Class docstring
((class_definition
body: (block . (expression_statement (string) @rst)))
(#offset! @rst 0 3 0 -3))
; Function/method docstring
((function_definition
body: (block . (expression_statement (string) @rst)))
(#offset! @rst 0 3 0 -3))
; Attribute docstring
(((expression_statement (assignment)) . (expression_statement (string) @rst))
(#offset! @rst 0 3 0 -3))
(comment) @comment @combined