Pattern Catalog - Can not parse pattern

Each time I run into a good application of Pattern Catalog, I end up not being able to create the pattern correctly. I usually only get the "Can not parse pattern" message. Why is there no further description of the error?

Even simple pattern like this will not pass:

Search:

private Guid $COMPONENTGUID$;

Replace:

private Guid $COMPONENTGUID$;

+ i added identifier placeholder COMPONENTGUID

(I know the pattern does not do anything, but why it can't be parsed?)

3 comments
Comment actions Permalink

Hello Jakub,

At the moment Search with pattern works on member body level only, so 'private
Guid $VARNAME$;' is not a valid pattern. A valid pattern would be any statement
or expression that can be found in a member body. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Each time I run into a good application of Pattern Catalog, I end up
not being able to create the pattern correctly. I usually only get the
"Can not parse pattern" message. Why is there no further description
of the error?

Even simple pattern like this will not pass:

Search:

private Guid $COMPONENTGUID$;

Replace:

private Guid $COMPONENTGUID$;

+ i added identifier placeholder COMPONENTGUID

(I know the pattern does not do anything, but why it can't be parsed?)

---
Original message URL:
http://devnet.jetbrains.net/message/5274608#5274608



0
Comment actions Permalink

Well, I am using the following search and replace pattern and it works fine

public $TYPE$ $IDENTIFIER$
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}


public $TYPE$ $IDENTIFIER$
{
get;
set;
}

and it is obviously not a part of member body.

Are there any enhancements of pattern catalog ahead?

0
Comment actions Permalink

Well, there is a limited support for some specific cases :)

We are working on Pattern Catalog improvement for ReSharper 6.0. You are welcome to share your ideas in our tracker: http://youtrack.jetbrains.net/issues/RSRP

0

Please sign in to leave a comment.