Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude directories from indexing in CLion

Tags:

clion

How do I exclude directories from being indexed in CLion?

I have several GB of data being indexed that are slowing everything down.

In PyCharm I can just right-click on the directory, but I don't find this option on CLion.

To be more concrete, I have a project with the following structure:

release/
release/results
source/
build/

the directory release/results contains several GB of data. CMakeList.txt only contains the list of files inside source/, however, the indexer is indexing the files inside release/results.

like image 869
Jorge Leitao Avatar asked Apr 15 '15 14:04

Jorge Leitao


3 Answers

As of CLion 1.5 (EAP for now), you can mark directories as either 'source', 'libraries' or 'excluded'.

See the full blog post describing the new feature:

Although CLion automatically excludes build directories from indexing, some users expect wider options. The same situation can happen when some folders are too big or located on network storage, making their indexing too expensive. To let CLion know that this is the case, you may want to manually exclude folders from indexing.

like image 79
etienne Avatar answered Oct 05 '22 03:10

etienne


Excluding a whole directory isn't possible, however you can exclude files by file type.

Preferences | Editor | File types

enter image description here

Beware that these settings aren't persisted after updating CLion to a newer version (at least this was the case for me when updating from 1.05 to 1.1).

like image 25
nburk Avatar answered Oct 05 '22 02:10

nburk


It's possible! It would help if you changed in .idea/YourProject.iml content block:

 <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
      <excludeFolder url="file://$MODULE_DIR$/public/bundles" />
      <excludeFolder url="file://$MODULE_DIR$/node_modules" />
    </content>

warning: You should write your excludeFolder lines

Is the solution not in any documentation in jetbrance, but employer from this company suggested this solution =)

like image 26
webdesus Avatar answered Oct 05 '22 02:10

webdesus