David Peden
David Peden

Reputation: 18454

Filtering ReSharper's "find usages" by file type

When I type alt-f7 against a class property in c# (in a web project), ReSharper scans through all files including javascript, html, and razor web views (.cshtml). Is it possible to tell ReSharper only to search against c# files?

Upvotes: 3

Views: 346

Answers (2)

NathanAldenSr
NathanAldenSr

Reputation: 7961

This doesn't appear to be possible. If you use the advanced Find Usages tool, you will see that ReSharper's only available scoping options are solution, libraries, solution and libraries, current project and current file. It would be awesome if they included a file type (.cs, .cshtml, etc.), object type (class, struct, enum, etc.) or similar scoping options.

Advanced Find Usages tool

Upvotes: 1

citizenmatt
citizenmatt

Reputation: 18583

ReSharper looks in file types that might not be obviously linked because it supports references between arbitrary file types. For example, xml config files can contain a reference to a C# type defined in the project, cshtml files will refer to other C# code, CSS classes can be used in C#. Find usages needs to collect all of these.

However, ReSharper is still being smart about what it scans. When you do a find usages, ReSharper looks the identifier up in a word index to get the list of files where it's being used. It then only looks at these files, rather than scanning all files in the solution.

Upvotes: 0

Related Questions