Skip to content

Fix python surrounding pairs in new tree-sitter-python version #328

Closed
@pokey

Description

@pokey

In newer versions of tree-sitter-python, it uses string_start and string_end as the type for string delimiter tokens. This will break all of our surrounding pairs in python.

We should fix this by actually looking at the token text to rather than just its type. We to be a bit careful though because for some cases we actually do prefer to use the type, for example with a format string or triple quote. We probably want to match the type, and then have a mapping from text to what kind of pair it is, eg f""" should map to doubleQuotes, etc. Note that this will require us to take into account language id when determining surrounding pair

We should probably solve this one after #1061

In addition, it uses string_content as the type for the content of the string, which appears to be different from today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions