Closed malthe closed 9 months ago
This would be better suited for injections, so you can then filter out the actual docstrings with queries, and inject "pydoc" into them. Take a look at jsdoc or luadoc for inspirations if you'd like to embark on that! But nothing is actionable here for that, so I'll close this out
Documentation on language injections: https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection.
Did you check the tree-sitter docs?
Is your feature request related to a problem? Please describe.
Doctests are typically embedded inside docstrings in Python code, e.g.
Today, the grammar does not parse docstrings and is oblivious to the doctests potentially lurking inside.
Describe the solution you'd like
The grammar should parse these doctests so that we can have proper editing support.
Describe alternatives you've considered
No alternatives have been considered.
Additional context
Some more discussion on the topic: