summaryrefslogtreecommitdiff
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
parent479fde3471ad6833d950abf645c0ebece15eaea4 (diff)
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
-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 db966e6c..04d0eed1 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