aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorJongwook Choi <wookayin@gmail.com>2024-01-25 16:14:41 -0500
committerChristian Clason <c.clason@uni-graz.at>2024-01-25 23:28:11 +0100
commitcb79d2446196d25607eb1d982c96939abdf67b8e (patch)
treeaa22e5e987376461cd7dfd35525ca1211d81fd83 /queries/python
parentFix find_usages (diff)
downloadnvim-treesitter-cb79d2446196d25607eb1d982c96939abdf67b8e.tar
nvim-treesitter-cb79d2446196d25607eb1d982c96939abdf67b8e.tar.gz
nvim-treesitter-cb79d2446196d25607eb1d982c96939abdf67b8e.tar.bz2
nvim-treesitter-cb79d2446196d25607eb1d982c96939abdf67b8e.tar.lz
nvim-treesitter-cb79d2446196d25607eb1d982c96939abdf67b8e.tar.xz
nvim-treesitter-cb79d2446196d25607eb1d982c96939abdf67b8e.tar.zst
nvim-treesitter-cb79d2446196d25607eb1d982c96939abdf67b8e.zip
feat(python): allow comments before module docstring
Example: ```python #!/usr/bin/env/python # some comment before module docstring # Copyright (c) LICENSE foo bar """module docstring.""" ``` Python indeed recognizes it: ``` $ python -c 'import testfile; print(testfile.__doc__)' module docstring. ```
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/highlights.scm2
1 files changed, 2 insertions, 0 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 329df4f14..0c7147b51 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -200,6 +200,8 @@
; doc-strings
(module
.
+ (comment)*
+ .
(expression_statement
(string) @string.documentation @spell))