Stream: general

Topic: rename all references


zeroexcuses (May 08 2020 at 05:23, on Zulip):

suppose we have

fn foo(...)

is it possible in Code to rename foo to bar, and also have it change all references of foo to bar ? (this is different from a global sed because if a bar does not refer to this particular foo, we don't want to rename it)

Lokathor (May 08 2020 at 05:44, on Zulip):

i think i remember there being a "rename symbol" ability?

Laurențiu Nicola (May 08 2020 at 06:47, on Zulip):

There is, press F2.

zeroexcuses (May 08 2020 at 08:58, on Zulip):

I must be doing something wrong. I have tried F2, Ctrl-F2, ctrl-shift-p Refactor -- and in all cases, it's only renaming the one in the trait, but not the ones in the impl traits, or the actual calls

zeroexcuses (May 08 2020 at 08:58, on Zulip):

Do I need something more than rust-analyzer ?

Laurențiu Nicola (May 08 2020 at 08:59, on Zulip):

You didn't mention traits :-). That's https://github.com/rust-analyzer/rust-analyzer/issues/4201.

Last update: May 29 2020 at 18:05UTC