Hyrial
Hyrial

Reputation: 1888

How do I rename a variable/method and all references in it in C# VSCode?

I see how to do it in javascript: https://johnpapa.net/refactoring-with-visual-studio-code/

But it doesn't seem to work with C# for some reason.

Upvotes: 4

Views: 4869

Answers (2)

UNK30WN
UNK30WN

Reputation: 64

To change the name at all occurances in current file.

1. select the word or var whatever.
2. press shift + F6
3. rename and press Enter

Upvotes: 0

K4R1
K4R1

Reputation: 885

You can select a piece of text and right-click it. The context menu has "change all occurences". but it only works for the open file in the editor.

Upvotes: 6

Related Questions