Excluding directory still gets indexed and show "Multiple definitions exists for class"

PhpStorm 2017.3.4

I have excluded some folders inside my vendor folder, and they are marked yellow in the Project view.  They are however still being indexed and PHPStorm still complains about "Multiple definitions exists for class" even though the other files are in the excluded directories.

When I "Go To" -> "Declaration" a window pops up and lists all the options, with the excluded ones with yellow background.

I have tried to invalidate cache, but it still indexes them.

Extremely frustrating that PHPStorm knows they are excluded, but indexes and shows them anyway.

Is this the right place to ask for help and/or report this bug?

0

Hi there,

>or report this bug

This is quite unlikely to be a bug -- more of a misconfiguration on your end or misunderstanding of how it all works.

Is such folder is part of a composer package? By default, composer packages are excluded and then re-added as PHP Include Paths. This way they are still able to participate in Code Completion etc but will be excluded for TODOs/inspections/refactoring etc.

If so -- you cannot "exclude" some subfolder from already excluded folder (that is included back via Include path).

What you may do here -- mark files with such duplicate classes as "Plain Text" (vi aright click in Project View panel) -- the file will NOT be treated as PHP so no duplicates will be found.

 

The above -- is most likely the reason and possible solution. If you think otherwise -- provide more info with screenshots that would describe situation in details; ideally -- complete test project.

0

Hello,

I have the same problem with more than a thousand classes. I use composer to retrieve sources that I then inject in the project to have it follow some updates but the project uses magento1 that does not support natively composer. I do not imagine myself right-clicking on each of the class to achieve my goal. Is there any other way ?

Thanks,

 

0

You can disable Settings/Preferences | Languages & Frameworks | PHP | Composer | Add packages as libraries in order to stop PhpStorm from adding your packages to Settings/Preferences | Languages & Frameworks | PHP | PHP Include.

Also, there's a relevant request: https://youtrack.jetbrains.com/issue/WI-42839

2

请先登录再写评论。