Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I search and replace structurally in Intellij

I am migrating my Junit tests from Junit v3 to Junit v4.

I was hoping to use the search and replace structurally "srs" to add an @Test annotation before all methods starting with test.* using my favorite IDE Intellij.

I just cant figura out how to do it... I can create a query that will find all methods without an annotation (there is an example bundled in Intellij) but when used to do a replace either my class gets replaced by only the method names OR nothing is found.

Maybe a regexp is easier :-)

like image 665
Konstantin Avatar asked Apr 30 '09 18:04

Konstantin


1 Answers

It is not possible, as of now, but there are requests for class members replacements.

Here is a useful link for getting started with ssr: https://www.jetbrains.com/idea/docs/ssr.pdf

like image 62
nicity Avatar answered Oct 20 '22 23:10

nicity