Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I refactor file names in Visual Studio Code?

Is it possible to refactor the name of the files in a project and automatically update all the imports, without caring about breaking something each time a file name is changed?

In the same manner as in the JetBrains' products. You change the file name and everything is automatically updated.

like image 911
Oleg Korol Avatar asked Nov 21 '16 07:11

Oleg Korol


People also ask

How do I Refactor a file name in Visual Studio?

Select Edit > Refactor > Rename. Right-click the code and select Rename.

How do you name a file with a VS code?

Usage. Right-click folder/file. Click 'Rename Files' on the Context Menu that appears. Choose your settings and enter the text you wish to replace.


1 Answers

Actually you can. Natively on Visual Studio Code (>= v1.28) with import path renaming:

Renaming JavaScript import path in VS Code

Or with some extension like Move TS.

like image 71
Machado Avatar answered Oct 26 '22 06:10

Machado