aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorRafik Draoui <rafik@rafik.ca>2021-12-26 20:54:39 -0500
committerStephan Seitz <stephan.seitz@fau.de>2022-01-04 23:15:30 +0100
commit9b262596e05eb1a129a717022b309cd1ad531345 (patch)
tree297bcf777e35a5b62772d08d98d0daf8d5054540 /queries/python
parentUpdate README (diff)
downloadnvim-treesitter-9b262596e05eb1a129a717022b309cd1ad531345.tar
nvim-treesitter-9b262596e05eb1a129a717022b309cd1ad531345.tar.gz
nvim-treesitter-9b262596e05eb1a129a717022b309cd1ad531345.tar.bz2
nvim-treesitter-9b262596e05eb1a129a717022b309cd1ad531345.tar.lz
nvim-treesitter-9b262596e05eb1a129a717022b309cd1ad531345.tar.xz
nvim-treesitter-9b262596e05eb1a129a717022b309cd1ad531345.tar.zst
nvim-treesitter-9b262596e05eb1a129a717022b309cd1ad531345.zip
Remove Python docstring injections
These injections lead to inconsistent highlighting since some edge cases aren't handled (as mentioned in the PR description that introduced the injections [0]). Besides, not all Python projects use reStructuredText syntax in docstrings. If someone still wants to use them, they can extend the base injection queries through `after/queries/` [1] or enable them with `vim.treesitter.set_query`. See also: https://github.com/nvim-treesitter/nvim-treesitter/pull/1204 [0]: https://github.com/nvim-treesitter/nvim-treesitter/pull/917 [1]: https://github.com/nvim-treesitter/nvim-treesitter/tree/ad69e2528ac382b7cbf28f1ac7ee450981734ab0#adding-queries
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/injections.scm18
1 files changed, 0 insertions, 18 deletions
diff --git a/queries/python/injections.scm b/queries/python/injections.scm
index db966e6ca..04d0eed1f 100644
--- a/queries/python/injections.scm
+++ b/queries/python/injections.scm
@@ -5,22 +5,4 @@
(#eq? @_re "re")
(#lua-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