I am trying to exclude some directories from Pycharm's project index as they are recursive symbolic links. I have excluded the directories and invalidated the caches and restarted but PyCharm still indexes these excluded directories. It does not result in duplicate results in my search results etc. but indexing takes so much longer.
Is there a way to exclude these directories from being indexed?
PyCharm allows you to exclude directories from consideration when searching and refactoring. You can exclude a directory by right-clicking on it and selecting Mark Directory as → Excluded.
Make sure the plugin is installedIn the Settings/Preferences dialog ( Ctrl+Alt+S ), select Plugins. Switch to the Installed tab, type Shared Project Indexes , and make sure that the checkbox next to it is selected. Otherwise, select the checkbox to enable the plugin. Apply the changes and close the dialog.
Indexing examines the code of your project to create a virtual map of classes, methods, objects, and other code elements that make up your application. This is necessary to provide the coding assistance functionality, search, and navigation instantaneously. After indexing, the IDE is aware of your code.
In order to stop PyCharm from indexing the 'lib' directory, right-click on this directory and select Mark Directory as, then Excluded. This directory will now no longer be indexed by PyCharm.
if i am right: File | Settings | project structure and select the folders you need and click exlcuded.
from documentation
Mark a folder as an excluded root.
Excluded roots are not visible to PyCharm. Usually, one would like to exclude temporary >build folders, generated output, logs, and other project output. Excluding the unnecessary >paths is a good way to significantly improve performance.
This command is duplicated on the context menu of a content root.
Besides @FooBarUser's suggestion, you can go to Preferences->Editor->File Types
and here you have a box where you can add the files and folders you want to exclude from your project.
The folders and files that you include will not be shown in your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With