Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code alternative to webstorm's "find usages"

In WebStorm there's a really nice feature that you can right-click a file and choose "Find usages...", what would output all the files and all the line numbers in the project where that file is referenced (e.g. where path to it is specified as a string in JS require).

I really love that feature, since it's very useful for refactoring - before I delete or edit smth I might want to find usages first to get clear understanding of what other things would be affected.

Is there a way I could do the same thing with VS Code?

Are there alternatives to Webstorm's "Safe delete" (when deleting a file it looks for usages first and shows a warning if there're some) and rename - so if I rename e.g. foo.js to bar.js all references to it in the project (e.g. paths within require) would be automatically updated?

like image 499
Tristan Tzara Avatar asked Mar 19 '17 14:03

Tristan Tzara


People also ask

How do you find all occurrences in VS Code?

Ctrl + Shift + L to select all occurrences of current selection. Save this answer.

How do you use Find and Replace in VS Code?

Find and Replace VS Code allows you to quickly find text and replace in the currently opened file. Press Ctrl+F to open the Find Widget in the editor, search results will be highlighted in the editor, overview ruler and minimap.

Where can I find tools in VS Code?

To open the Visual Studio Installer, choose Tools, and then choose Get Tools and Features.... Then install the Visual Studio extension development workload.

How do you select similar words in VS Code?

For multi-select, you can use CTRL-SHIFT-L. You can click over the word and then press key combinations(CTRL-SHIFT-L) this will select all same types of words from the file(vs-code).


1 Answers

Unfortunately there are no built in ways to do this in VS Code and I don't know of any extensions to do this, either.

like image 173
Llewey Avatar answered Sep 23 '22 22:09

Llewey