PhpStorm - Exclude directory from “ctrl + shift + n” command

后端 未结 1 532
忘了有多久
忘了有多久 2021-01-07 06:15

I am working with Symfony. Every time I use \"ctrl+shift+n\" to go to a file, PhpStorm is looking into every vendors to try to find the file and thus spoils the

1条回答
  •  囚心锁ツ
    2021-01-07 07:14

    Your only option right now is to do what you did -- exclude folders from vendors directory. You just need to do it a bit differently -- you still need to reference it back...

    1. Instead of excluding the whole folder, exclude specific subfolders (e.g. vendors/symfony)
    2. Add such folder back via Include Paths (Settings (Preferences on Mac) | Languages & Frameworks | PHP)

    In theory -- excluding whole vendor folder and then adding it back via Include Paths will also work .. but I prefer having a bit better control and do it on individual packages/vendors level.

    Plus, the Composer integration does basically the same (if such option is enabled) but will do it on actual package level (vendors/symfony/symfony) instead of proposed here upper vendor level (vendors/symfony).


    After you do this you will see results from such excluded folders ONLY if there will be no matches in actual project files... or if you enable inclusion of non-project matches.


    If you are using Composer ... just enabling that option should be enough (you need to provide path top your composer.json for that, of course)

    enter image description here

    enter image description here

    enter image description here


    UPDATE 2020-08-15: Since 2020.1 or so you can use Scopes in Ctrl + Shift + N popup and alike (Search Everywhere, navigate to File/Class/Symbol/etc).

    P.S. It may not be remembered between IDE sessions (there are tickets about that) but definitely remembered in the same session.

    0 讨论(0)
提交回复
热议问题