Skip to content

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

Merged
clason merged 1 commit into
nvim-treesitter:mainfrom
fionn:swap-query-strings-type-list
Jul 19, 2026
Merged

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

Conversation

@fionn

@fionn fionn commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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.
@clason
clason merged commit 898ee30 into nvim-treesitter:main Jul 19, 2026
3 checks passed
@fionn

fionn commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks!

@fionn
fionn deleted the swap-query-strings-type-list branch July 19, 2026 11:20
fionn added a commit to fionn/.dotfiles that referenced this pull request Jul 19, 2026
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.

2 participants