Skip to content

queries can't match the last pipe_element in a pipeline #215

Description

@Bahex

I’m not sure if this is a bug in our parser or in tree-sitter.

nushell source

tree-sitter query

  1
| 2
| 3
(pipeline . (pipe_element)  @first   )
(pipeline   (pipe_element)  @last_ . )

With the tree-sitter cli:

> tree-sitter query -c query.scm source.nu
source.nu
    pattern:  0, capture: 0 - first, start: (0, 2), end: (0, 3), text: `1`
    pattern:  1, capture: 1 - last_, start: (0, 2), end: (0, 3), text: `1`
    pattern:  1, capture: 1 - last_, start: (1, 2), end: (1, 3), text: `2`
    pattern:  1, capture: 1 - last_, start: (2, 2), end: (2, 3), text: `3`

Within neovim:

First Last

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions