Skip to content

RST grammar not injected into sub-directives #51

@wjakob

Description

@wjakob

The current version of the tree-sitter RST parser does not process RST grammar embedded into directives like .. warning::, .. note::, etc. See here for an example of such a document and the parse tree shown in NVIM. Note the absent syntax highlighting of the reference.

Screenshot 2024-03-08 at 22 06 48

Curiously, it works when the directive is further annotated:
Screenshot 2024-03-08 at 22 08 00

PS: I am skeptical if the document element makes sense occurring within the tree in this way. When I try to add a custom tree-sitter rule that matches on this element to manually inject the RST grammar into document, I get an error message from NVIM saying that the following structure is impossible.

Screenshot 2024-03-08 at 22 11 42

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamA problem originated from nvim-treesitter or tree-sitter

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions