Skip to content

Sort methods alphabetically only shows when selecting #19852

@djmarcin

Description

@djmarcin

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rust-analyzer version: 0.3.2466-standalone (e464ff8 2025-05-18)

rustc version: (eg. output of rustc -V)

rustc 1.87.0 (17067e9ac 2025-05-09)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)

Cursor & VSCode
Extension version: 0.3.2466

code snippet to reproduce:

impl Foo {
    // baz
    fn baz() {}
    // bar
    fn bar() {}
}

If you position your cursor on Foo and hit Ctrl/⌘+. it will show only the "generate trait from impl" quick action:
Image

However if you highlight any portion of "impl Foo {" or the final "}" or some (but not all) internal whitespace of the impl block (as little as one character, as many as all characters, even spaces), it will show additional quick actions:
Image

Curiously, when selecting the entire impl block, the sort quick action is again not present.

This is extremely undiscoverable -- surely these quick actions should show up any time the cursor is on a relevant region, not just when a selection is active?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions