Skip to content
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

Multi cursor postfix snippets only work correctly for the first cursor #11841

Open
tjallingt opened this issue Mar 29, 2022 · 3 comments
Open
Labels
A-vscode vscode plugin issues C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@tjallingt
Copy link

tjallingt commented Mar 29, 2022

rust-analyzer version: bc08b8e 2022-03-28 stable

rustc version: 1.58.1 (db9d1b20b 2022-01-20)

relevant settings: N/A

match result {
    Some(_) => {
        assert!(wip.is_empty());
        /* ... */
    },
    None => {
        assert!(wip.is_empty());
        /* ... */
    }
};

In code above I want to quicky invert the assert conditions, so I select the first wip.is_empty() and select the next occurence with Ctrl+D. Then I type .not at the end and press enter.

The result is

match result {
    Some(_) => {
        assert!(!wip.is_empty());
        /* ... */
    },
    None => {
        assert!(wip.is_empty().!wip.is_empty());
        /* ... */
    }
};

(This may be an issue with VS Code, but I don't know how to tell. If so I can close this and report it to VS Code)

@Veykril
Copy link
Member

Veykril commented Mar 29, 2022

This is blocked on the LSP not providing us with multiple cursors, and it doesn't seem to be on the roadmap currently: microsoft/language-server-protocol#22

But maybe we are able to put this in as an LSP extension.

@flodiebold
Copy link
Member

flodiebold commented Mar 29, 2022

I don't know, that seems like a VSCode bug to me. There are probably multiple ways one could think this should work, but the actual result is not one of them.

(And I somewhat agree with the points made in the LSP issue that this doesn't seem like something LSP should be concerned with either.)

@lnicola
Copy link
Member

lnicola commented Dec 9, 2022

FWIW, https://helix-editor.com/news/release-22-12-highlights/ shows this already working, in a way.

@Veykril Veykril added A-vscode vscode plugin issues S-unactionable Issue requires feedback, design decisions or is blocked on other work C-bug Category: bug labels Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

4 participants