Stream: t-compiler/rust-analyzer

Topic: insert mode exited request


Manmeet Mann (Jun 10 2021 at 14:49, on Zulip):

say I am in command mode.

struct X {
    $0
}

I enter insert mode and type foo: i32 and exit insert mode

struct X {
    foo: i32$0
}

now I want rust analyzer to _somehow_ fix all uses of X.
any suggestions how to implement this

Laurențiu (Jun 10 2021 at 14:50, on Zulip):

We have a feature where you use a structure field that doesn't exist, you get a diagnostic and a fix to add it to the struct definition

Laurențiu (Jun 10 2021 at 14:52, on Zulip):

But there's no way to add it to every usage of the struct

Manmeet Mann (Jun 10 2021 at 14:53, on Zulip):

another example will be with function arguments

Florian Diebold (Jun 10 2021 at 14:53, on Zulip):

somewhat similar to 6499

Florian Diebold (Jun 10 2021 at 14:54, on Zulip):

but I don't know if one insert mode operation would be the right granularity for this

Manmeet Mann (Jun 10 2021 at 14:56, on Zulip):

I think it will good enough for most of cases. we can always have explicit start and end requests

matklad (Jun 10 2021 at 14:56, on Zulip):

I'd like to experiment with change signature "auto-refactor".

Manmeet Mann (Jun 10 2021 at 14:58, on Zulip):

oh commenting is a good idea

Last update: Jul 26 2021 at 14:15UTC