Skip to content

Sort methods alphabetically only shows when selecting #19852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
djmarcin opened this issue May 23, 2025 · 1 comment
Open

Sort methods alphabetically only shows when selecting #19852

djmarcin opened this issue May 23, 2025 · 1 comment
Labels
C-bug Category: bug

Comments

@djmarcin
Copy link

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?

@djmarcin djmarcin added the C-bug Category: bug label May 23, 2025
@ChayimFriedman2
Copy link
Contributor

The extract type assist should not appear unless you select some type, a single cursor is not enough. This is similar to the extract variable/function assists.

The "Sort methods alphabetically" should probably appear even when nothing is selected, but it's tricky to define when exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants