Skip to content

Upgrade tree-sitter-rust #1201

Open
Open
@pokey

Description

@pokey

The latest version of tree-sitter-rust makes several changes, one of which has to do with the way that token trees within macros are parsed, which breaks our name scope within attributes (https://github.com/cursorless-dev/cursorless/blob/main/src/test/suite/fixtures/recorded/languages/rust/changeNameFine2.yml)

We should probably handle this one by constructing a text-based version of name that uses a regex to find structures of the form foo=bar, baz=bongo. We need a regex because Rust token trees don't actually have any structure. We'd probably use something like #1047 here

  • Note that we will also want to tweak our condition implementation, as if_let_expression and if_while_expression are no longer special node types. We should be able to just remove the special cases for these. The if_expression[condition] and while_expression[condition] patterns should handle them properly without modification
  • We should add support for let-else constructs to the branch scope type once this one is fixed as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions