IntelliJ File mask not working on simple excluding file pattern! Why?

7.1k views Asked by At

Follows this page https://www.jetbrains.com/help/pycharm/2016.1/find-and-replace-in-path.html?origin=old_help#mask , it should be able to exclude many files using "!" symbol in front of the regular pattern like: *.java, when doing text search inside IntelliJ projects.

On my project, when I fired Ctrl + Shift + F to do text search for string xyz. There's over 100+ results return in both *.ftl and *.java files. I tried to reduce the results on only ftl files by changing the "File mask(s)"-Option to "!*.java" . But it did not work! The result list is empty!

Googling on the excluding file pattern results in creating custom file filters for each particular search, which I don't want to maintain!

Do I miss something here or IntelliJ is just bad on this function (I'm using IntelliJ 15)? With Eclipse, the "File mask" was amazing!

4

There are 4 answers

0
Piotr Korlaga On

You have to use !*.java instead of !.java

0
Kevin On

Excluding file paths in the Find in Path dialogue was not added until IntelliJ 2016.1 per this IntelliJ forum response.

0
WesternGun On

As for IDEA 2019.1 Ultimate, it works for me(exclude with !*.yml or anything else).

If it does not in yours, as you only as .ftl file to exclude, why not add mask as *.java?

PS: what does not work is exclude some path, like "all files under out/ folder". With !out/* or anything ales it does not work.

1
Digital Alpha On

Forget about File Mask and use Scope:

scope image

In Scope the options are unlimited where you can select folder include/exclude files or folders.