Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resharper rename - prevent from searching references in all files

I'm using Typescript and Visual Studio 2015 with Resharper 9. Lets say I want to rename my angular controller method from activate to init. What happens is that Resharper start searching through all suspicious references in libs like angular.js, jquery.js and so on. It also scans all razor views to find possible usages. This operation some times is really slow and is not logical because I will never want to rename something in angular.js library. How can I skip such files from scanning at all?

Resharper rename

like image 950
Andzej Maciusovic Avatar asked Nov 20 '15 07:11

Andzej Maciusovic


People also ask

How do I Rename all references in Visual Studio?

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

What shortcut key is used to Rename method in ReSharper?

Press Ctrl+Shift+R and then choose Rename. Right-click and choose Refactor | Rename from the context menu. Choose ReSharper | Refactor | Rename… from the main menu.

How do I Rename my rider?

Press Ctrl+Shift+R and then choose Rename. Choose Refactor | Rename from the main menu.


2 Answers

In Resharper 2016.3 JetBrains have introduced Third Party Code. This allows to completely ignore folders or pattern-matched files for JS libraries.

Third Party Code in R#

I've tried and this indeed ignores excluded files for scan on renames.

However I'm not entirely sure why they have added yet another location where to specify ignored files. They already had Elements to Skip in Code Inspection => Settings and in Environment => Search & Navigation

UPDATE through this screen you can't exclude files/folders that are not part of the VS solution. There is a bugreport to that effect. Please vote and comment there.

like image 197
trailmax Avatar answered Sep 25 '22 03:09

trailmax


According to the comments here https://www.jetbrains.com/help/resharper/2016.1/Refactorings__Rename.html it is not possible to exclude specific files or filemasks. It has been asked for, though.

Update: With the release of ReSharper 2016.3 it is now possible to exclude folders, specific files and filemasks. Please see trailmax's answer.

like image 45
hsop Avatar answered Sep 22 '22 03:09

hsop