You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
pokey
changed the title
Fix python twin surrounding scope type
Fix python surrounding pairs in new tree-sitter-python version
Jul 7, 2023
pokey
changed the title
Fix python surrounding pairs in new tree-sitter-python version
Fix python surrounding pairs in new tree-sitter-python version
Jul 7, 2023
Note that this was partially fixed in #2409, but we still don't yet actually look at the text of the delimiters, just their type, which is always string_start / string_end, so we don't properly distinguish between single and double quotes. Ie if you say "take twin" inside double quotes, it will select them.
In newer versions of tree-sitter-python, it uses
string_start
andstring_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 todoubleQuotes
, etc. Note that this will require us to take into account language id when determining surrounding pairWe 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.The text was updated successfully, but these errors were encountered: