VS Code alternative to webstorm's “find usages”

眉间皱痕 提交于 2021-01-26 22:29:32

问题


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?


回答1:


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.




回答2:


Actually you can open the helper console ( Cmd + Shift + P in mac and the shortcut is Shift + F12) and go to find all usages



来源:https://stackoverflow.com/questions/42888028/vs-code-alternative-to-webstorms-find-usages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!