Skip to content

[Feature] Code actions in visual mode #800

@mrcjkb

Description

@mrcjkb

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions