-
-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Can probably be implemented the same way the RustLsp ssr
command is implemented for visual mode.
Example (discussed in #799)
Originally posted by kulikg July 6, 2025
Checked other resources
- This is not a bug report or a question (Please use issues for those).
- I have searched existing discussions.
- I have searched existing issues.
- This cannot be implemented in rust-analyzer.
- I have added a very descriptive title to this feature request.
Feature description
Hi,
I would really love to see this one working in rustaceanvim: https://rust-analyzer.github.io/book/assists.html#extract_function
I took a quick look into it. As you can see the extract function will quit right away if the selection range is empty:
https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L67
While rustaceanvim is not sending the selection range to the language server:
https://github.com/mrcjkb/rustaceanvim/blob/master/lua/rustaceanvim/commands/code_action_group.lua#L400
Actually I've patched code_action_group() quickly, and it seems the rest is fine, the lsp response is handled ok.