ZIm/crates/languages/src/python
jfmontanaro bb59e7f217
Refine syntax highlighting for Python docstrings (#20898)
Following up on #20763, this PR adds support for module- and class-level
docstrings, adds "additional docstrings" as described in [PEP
257](https://peps.python.org/pep-0257/), and fixes function-level
docstrings so that only the first string literal in a function gets
treated as a docstring.

One question that occurs to me is: Would it be good to capture attribute
and additional docstrings differently from regular docstrings? E.g.
`@string.doc.attribute`, `@string.doc.additional`? PEP 257 mentions that
unlike regular docstrings, these docstrings are ignored by the
interpreter (regular docstrings get added as the `__doc__` property of
the object they document), so I can see someone potentially wanting to
style them a little differently.

Release notes:

* Added Python syntax highlighting for class- and module-level
docstrings, additional docstrings, and improved recognition of
function-level docstrings.

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-01-28 10:23:43 +01:00
..
brackets.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
config.toml python: Improve handling of triple-quoted strings (#20664) 2024-11-14 15:12:46 +01:00
embedding.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
highlights.scm Refine syntax highlighting for Python docstrings (#20898) 2025-01-28 10:23:43 +01:00
indents.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
outline.scm assistant: Add annotations to more languages (#15866) 2024-08-07 13:47:21 +02:00
overrides.scm Add inclusive range scope overrides. Don't auto-close quotes at the ends of line comments (#20206) 2024-11-04 15:36:39 -08:00
runnables.scm python: Fix decorated test detection (#22327) 2024-12-21 13:11:52 +00:00
textobjects.scm Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00