Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide files from /build directory in navigate class/file action

One of the most productive actions in Android Studio is Navigate action. The problem is it shows so much useless files. Sometimes it's hard to find the class/file you're looking for.

Take below image as an example. If you're looking for AndroidManifest.xml in module b you have to scroll down the list to find the file you want.

enter image description here

Is there a way to filter what this dialog shows, in particular exclude some directories from results? All of the files from the /build directory are completely useless.

I know that I can filter what types of files are shown but it doesn't help much.

like image 972
tomrozb Avatar asked Nov 10 '22 15:11

tomrozb


1 Answers

Mark your build folder as excluded:

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

Alternatively, right click on your build 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

Another way is to define a custom scope as described here.

like image 124
Darek Kay Avatar answered Jan 04 '23 02:01

Darek Kay