Find and Replace in Path: Exclude Test Files?

Answered

Using the "Find in Path" dialogue, how do I search for a String, say "xyz" in any file, except JUnit test files (ending in *Test.java)?

 

I tried to enter the following, with no success:

  • *.java, !*Test.java
  • !*Test.java

I don't really understand the following from the help, too:

Note also, that negated pattern (for example, !*.min.js) has implicit inclusion pattern *. This allows avoiding such constructs as *, !*.min.js for every file except minified javascript).

Does that mean that !*.min.js will yield the same results as *, !*.min.js?

4 comments
Comment actions Permalink

> Does that mean that !*.min.js will yield the same results as *, !*.min.js?

Yes, it's how it should work.

1
Comment actions Permalink

Given the Help page, I would expect the above to give me a list of all my files (especially all Java files), except for XML files (like my POM.xml). It does, however, not seem to return a single match... :'(

>> If text to find is not entered, and this check box [File mask(s)] is selected, then IntelliJ IDEA find all files matching the specified mask, regardless of their contents.

I'm running build 15.0.4 64 bit on Windows.

0
Comment actions Permalink

That would explain things. Doesn't explain how I ended up on the help page for 2016.1 when I pressed F1 on the 15.0.4 dialogue, though... ;-)

0

Please sign in to leave a comment.