Quick-fixes are also provided for the patterns - they could transform matched code blocks as defined in the 'replace' part of the pattern.
This means that all code blocks that match a specific pattern can be highlighted in the editor as hints, suggestions, warnings, or errors. Using structural patterns as custom inspections and quick-fixes is illustrated in the corresponding topic of the code analysis sectionĪll patterns that you create are stored in your pattern catalog and act as custom code inspections with custom severity levels. The pattern can be as complex as you need and have any desired level of detail. For example, you can create a general pattern that will match all foreach loops independently of what is iterated and what is inside the loop, or you can make this pattern more detailed to find only loops that iterate over a specific type. These blocks may be quite different - they could contain different types, expressions, statements, and so on, but they would be logically similar. ReSharper allows you to find and, if necessary, replace blocks of code that match a specific pattern. For example, you may need to find code smells specific to your project or find pieces of code that need to be refactored. Sometimes standard search methods, like searching for usages of a certain symbol or text occurrences that match some regular expression do not give the desired results.