Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 761 Bytes

File metadata and controls

34 lines (26 loc) · 761 Bytes

tree-sitter-pydoc

A tree-sitter grammar supporting Python docstrings.

Inspired by tree-sitter/tree-sitter-python#251

Configuration

Configure your editor using injections, required for Python and Pydoc.

Helix Editor

; ~/.config/helix/runtime/queries/python/injections.scm
(expression_statement
  (string
    (string_start)
    (string_content) @injection.content
    (string_end))
  (#set! injection.language "pydoc"))
; ~/.config/helix/runtime/queries/pydoc/injections.scm
(docstring
  (statement
    (statement_content) @injection.content)
    (#set! injection.language "python"))

(docstring
  (statement
    (statement_result) @injection.content)
    (#set! injection.language "python"))