How to prevent indexing the vendor folder


I'm working on a PrestaShop project and I want to prevent indexing the vendor folder

The first thing that I tried was to exclude the vendor folder

But it was still being indexed

I searched the settings related to PHP and Composer but with no luck

I also checked similar threads (about node_modules) but didn't get a hint on how to solve this

Please advise

Thank you



PhpStorm 2019.1.2
Build #PS-191.7141.52, built on May 8, 2019
Licensed to ----
Subscription is active until November 27, 2019
JRE: 1.8.0_202-release-1483-b49 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-50-generic

Comment actions Permalink

Hi there,

Please check "PHP | Include Paths". Libraries added this way will still be indexed even if excluded via "Directories".

P.S. By default all stuff from composer will be added as Include Paths entries (External Libraries). This behaviour can be disabled so you can have full control.

P.P.S. Please note that if you completely exclude your vendor content then you will have NO code completion for classes & functions from those folders.

Comment actions Permalink

Thank you for the valuable information

Best regards

Comment actions Permalink

Woah! Andriy, thank you! This has been driving me bonkers for years! You have no idea how many times I have tried to exclude vendor and just really didn't understand why it was still indexed. Now this all makes sense and realize I don't want it excluded. 

UX: I think Intellij should not let a user mark a directory as excluded if it is an include path. The context menu should say something like "exclusion disabled because it is an include path" or something to indicate that the exclusion is non-active. 

Until then, so happy to have this sanity back! Thanks

Comment actions Permalink

Andriyn you said:

"P.S. By default all stuff from composer will be added as Include Paths entries (External Libraries). This behaviour can be disabled so you can have full control."


Comment actions Permalink


Settings/Preferebces | Languages & Frameworks | PHP | Composer | Add packages as libraries

Comment actions Permalink




P.S. Unticking that option does not do anything. I mean: it will NOT undo the changes that IDE does when it's enabled.

Disabling that option simply tells IDE to not to add newly detected composer-included packages as libraries (which marks folder as Excluded and then adds it back as PHP Include Path entry).

You have to manually remove any unwanted entries from the PHP Include Paths.

Comment actions Permalink

Since some days I'm really f***ed from either that feature or I just don't know what else: I removed all excludes and includes; invalidated caches several times; removed .idea folder in the project etc. still the same - some vendor packages are not indexed at all; some classes map to namespaces... I have the feeling indexing is broken in 2021.1

Comment actions Permalink


You better have this as a new thread as it does not seem related to the topic of this post.

I suggest you do that + disable all custom (not bundled by default) plugins, do the Invalidate caches (with top 2 options checked there), and restart the IDE. If still the same -- need to see logs, your project setup. Right now it could be some (outdated?) plugin... (a guess based on past observations on the threads/tickets here).

For me Carbon get recognized just fine in a typical Laravel project (be it fresh project or 2 years old one).


Please sign in to leave a comment.