Skip to content

Permit swap_previous, swap_next to take a list of query strings#892

Open
fionn wants to merge 1 commit into
nvim-treesitter:mainfrom
fionn:swap-query-strings-type-list
Open

Permit swap_previous, swap_next to take a list of query strings#892
fionn wants to merge 1 commit into
nvim-treesitter:mainfrom
fionn:swap-query-strings-type-list

Conversation

@fionn

@fionn fionn commented Jul 3, 2026

Copy link
Copy Markdown

The swap_next function takes a query_strings argument. Despite this being plural, the type annotation claims that this should be a string. However, we pass this argument to swap_textobject which expects type string | string[].

This also makes the swap functions better correspond to those of move, e.g. goto_next_start also accepts query_strings of type string[].

The same holds also for swap_previous.

The swap_next function takes a query_strings argument. Despite this
being plural, the type annotation claims that this should be a string.
However, we pass this argument to swap_textobject which expects type
string | string[].

This also makes the swap functions better correspond to those of move,
e.g. goto_next_start also accepts query_strings of type string[].

The same holds also for swap_previous.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant