Ignore parts of the code
In most solutions, there are parts of the code where you want to disable some or all of ReSharper features. This topic lists all available ways to make ReSharper ignore specific parts of the code.
Scenario | Improve performance by not indexing and not analyzing projects that contain third-party or frozen code, which is not going to be changed. |
How to ignore | List file masks of the projects that should be ignored (for example, Project*.csproj) under Projects to ignore on the Code Inspection | Ignored Code page of ReSharper options Alt+R, O. |
What is disabled | Almost all ReSharper features, for example code analysis, code completion (intellisense), refactorings, code generation. |
What is available | After you build projects ignored in this way, symbols from that projects will be recognized by code analysis and code completion (intellisense) in other projects, and they will also be available via navigation and search. |
Scenario | Minimize unwanted results in design-time code inspection and code inspection in specific scope by ignoring parts of code that you are not going to improve. |
How to ignore |
|
What is disabled | All code inspection features as well as structural search and replace. |
Scenario | Ignore generated parts of the code to minimize unwanted results in design-time code inspection and code inspection in specific scope but do not ignore errors and warnings in that parts to make sure that the generated code compiles. |
How to ignore |
|
What is disabled | Code inspections with lower severity levels as well as code cleanup. |
Scenario | Remove unwanted items from the results of search and navigation. |
How to ignore | List specific files and folders or file masks (for example, Test*.cs) under Elements to skip on the Environment | Search & Navigation page of ReSharper options Alt+R, O. |
What is disabled | All navigation and search commands except Go to Declaration and Go to Type of Symbol, which will be available on usages of symbols from the ignored files. |
Scenario | You may want some types, members, or namespaces not to be suggested, for example, if you have something similar to a system type in your solution, say |
How to ignore | To exclude such items from the suggestions, add them to the Exclude from import and completion list on the Code Editing | Type Import page of ReSharper options Alt+R, O. The format of the entries is |
What is disabled | The specified items will not appear in import namespace suggestions and in code completion suggestions. |
Scenario | Completely ignore files that are implicitly used in your project to improve performance and minimize unwanted results in code analysis and navigation. Such files would normally be recognised as C++, JavaScript, TypeScript or JSON. For example, generated, minified files, implementations of third-party components that must be included in your project, or scripts that were already gzipped. |
How to ignore | List specific files and folders or file masks (for example, *.min.js) under Skipped code on the Code Editing | Third-party code page of ReSharper options Alt+R, O. |
What is disabled | All ReSharper features in these files. If symbols from these files have direct usages in other places, these usages will not be resolved and highlighted as errors. |
Scenario | Minimize unwanted results in design-time code inspection and code inspection in specific scope by ignoring parts of code that you use directly but do not maintain, such as jquery.js. |
How to ignore | List specific files and folders or file masks (for example, *.ref.js) under Library code on the Code Editing | Third-party code page of ReSharper options Alt+R, O. |
What is disabled | Code inspection to this code and will not try to modify this code with quick-fixes and refactorings. |
What is available | Symbols from ignored files will be recognized by code analysis and code completion (intellisense) in other files, and they will also be available via navigation and search. |