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

4

13

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!

Dogwood answered 28/3, 2016 at 12:40 Comment(0)
S
14

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

Supranatural answered 28/3, 2016 at 13:55 Comment(0)
A
4

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.

Approbation answered 22/7, 2019 at 8:53 Comment(0)
S
1

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.

Sagamore answered 26/2, 2020 at 16:56 Comment(1)
This was useful for me when I wanted to find and replace in non-test files.Colloquial
K
0

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

Kincaid answered 12/3, 2019 at 20:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.