Skip to content

AST depends of order of edit actions. #44

@Carreau

Description

@Carreau

On https://stsewd.dev/tree-sitter-rst/

list:
                                                         
 - item2
 - item2

Parses as

document [0, 0] - [4, 0]
  paragraph [0, 0] - [0, 5]
  block_quote [2, 1] - [3, 8]
    paragraph [2, 1] - [3, 8]

But if you edit the first space of the line in front of item2 and add it again, it becomes

document [0, 0] - [4, 0]
  paragraph [0, 0] - [0, 5]
  block_quote [2, 1] - [2, 8]
    paragraph [2, 1] - [2, 8]
  bullet_list [3, 1] - [3, 8]
    list_item [3, 1] - [3, 8]
      body [3, 3] - [3, 8]
        paragraph [3, 3] - [3, 8]
ts-state.mov

I'll try to have a reproducer via Python API another time. I don't know if it's tree-sitter-rst of tree-sitter bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions