nvim-treesitter/queries/python
Santos Gallegos af36d31cb7
Python: inject rst in docstrings (#917)
Since hasn't been much discussion around
https://github.com/nvim-treesitter/nvim-treesitter/issues/806.
I'm just porting the injection queries.
I've been using this for a while now.

Things I've noticed:

- Due that rst uses indentation for its syntax,
  everything is treated as an block quote (but it looks good).
  This can be solved by having a predicate like `#dedent!`.
- Looks like there is a bug in how the injected content is extracted

  ```
  def foo():
      """Foo bar"""
  ```

  That would be parsed as a section title for some reason,
  but it's a paragraph.

  In rst it would be a title if the content was:

  ```
  """
  Foo bar
  """
  ```

  If the content is

  ```
  """Foo bar"""
  ```

  That's just a paragraph.

I'll try to debug that from the neovim side next week or so.
2021-02-05 15:01:50 +00:00
..
folds.scm Python (folds): allow to fold strings 2021-01-02 04:21:47 +01:00
highlights.scm Python highlights: update definition of decorator 2021-01-07 08:52:41 +01:00
indents.scm indent: add Python @ignore queries 2021-01-14 13:54:43 +01:00
injections.scm Python: inject rst in docstrings (#917) 2021-02-05 15:01:50 +00:00
locals.scm Python locals: Add new node with_clause 2021-01-07 08:52:41 +01:00