IR> Hi,IR> IR> I would really appreicate it you could please demonstrate how to useIR> the structured search / patterns catalogue / search with pattern inIR> R#5?IR> IR> Showing how to search for the above would be great, as well as otherIR> scenariosIR> IR> Thanks!IR> DominiqueIR> ---IR> Original message URL:IR> http://www.jetbrains.net/devnet/message/5256238#5256238

Based on your explanation, I was able to define the placeholders and define a search pattern.

Here's a little bit of feedback on the placeholder dialogs:

For expressions, you might want to put some very common expression types in the drop down list (int, bool, object, etc..)

For statement placeholders, I found it a little bit unintuitive to use checkboxes to specify "at least x" and "at most x", maybe a drop down list for common selections might make it more intutiive and that interface as "advanced" for more "advanced" selections.

Also, it wasn't intutitive that you had to surround placeholders with "$" characters, and if you mess up, the error "can not parse pattern" is not very helpful.

Also, it would be cool to drag and drop placeholders in the search patterns

Another thing I noticed:

I defined a pattern to search for blocks of more than 25 statements, and I noticed that say in a method that had 30 statements, it would report this 5 times - it might be overcalculating in some cases

These are all improvement suggestions, it's awesome to see these feature in this tool!!

Your first pattern can not be found, because you forgot semicolon at the end. Second pattern runs fine, because its parsed as expression, while first one is a statement, and can not be parsed as expression.

Also I suggest you change your first pattern to

if ($argument$ == null) thrownew $exp$($msg$, $param$);

Where $msg$ and $param$ are expressions of type System.String. And therefore your replace pattern will be:

For expressions, you might want to put some very common expression types in the drop down list (int, bool, object, etc..)

You can easily filter this list inplace, like in any other type selection field in R#, just type "int" and you'll see.

For statement placeholders, I found it a little bit unintuitive to use checkboxes to specify "at least x" and "at most x", maybe a drop down list for common selections might make it more intutiive and that interface as "advanced" for more "advanced" selections.

Thanks for suggestion, we will consider it for future versions.

Also, it wasn't intutitive that you had to surround placeholders with "$" characters, and if you mess up, the error "can not parse pattern" is not very helpful.

We will provide error highlighting later.

Also, it would be cool to drag and drop placeholders in the search patterns ;)

I defined a pattern to search for blocks of more than 25 statements, and I noticed that say in a method that had 30 statements, it would report this 5 times - it might be overcalculating in some cases :)

I just tried to search "{$stmt$}", where stmt - is "at least 25 statements" and got every long method only once in search results. How did you get it?

Ok, if somebody else interested in how to accomplish this:$enumerable$ - expression of System.Collections.IEnumerable or derived$condition$ - did not work for me as expression, so i have it defined as an argument

The pattern search it the great and very useful feature, but needs some improvementsIt bothers me that i can not replace a selected pattern part with Ctl+V or simply typing. I must use backspase.Very useful would be "Create pattern from selection" option.And some more improvement suggestions:, e.g. if i rename a pattern parameter it should be also renamed in the pattern text and vice versa, may be something like "refactor rename"?string with regex as a pattern parameter working similar to Find in text from Power toys.