Warm tip: This article is reproduced from stackoverflow.com, please click
intellij-idea intellij-14

Ignore a folder in search results

发布于 2020-03-29 12:46:14

I'm searching for a string and getting matches in a source folder, and a build folder (file in source gets copied to build during build).

I do not need the build folder result.

Vim has wildignore which helps filter out results.

Is there something similar in intelij?

Questioner
Eric Francis
Viewed
58
Darek Kay 2018-05-09 17:14

Mark your build folder as excluded:

File > Project Structure > Modules > Sources > Mark as Excluded (red icon)

You can also just right click on your folder and select Mark Directory As > Excluded.

Excluded folders (shown as rootExcluded) are ones that IntelliJ IDEA "partially ignores". Very limited coding assistance is provided for files in excluded folders. Classes contained in excluded folders don't appear in code completion suggestion lists, references to such classes are shown in the editor as unresolved. When searching, IntelliJ IDEA doesn't look in excluded folders, etc.

Source

Note: See the answer by Nader Hadji Ghanbari for another approach using Scopes.