Find and Replace in Path: Exclude Test Files?
已回答
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?
请先登录再写评论。
> Does that mean that !*.min.js will yield the same results as *, !*.min.js?
Yes, it's how it should work.
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.
This feature was added in 2016.1: https://youtrack.jetbrains.com/issue/IDEA-23316.
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... ;-)