PhpStorm-从"ctrl + shift + n"目录中排除目录命令 [英] PhpStorm - Exclude directory from "ctrl + shift + n" command
问题描述
我正在与Symfony合作.每次我使用"ctrl + shift + n"转到文件时,PhpStorm都会查找每个vendors
来尝试查找该文件,因此会在提示时给与不相关的建议以破坏.
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 prompt with irrelevant suggestions.
我尝试过的一种解决方案是从项目中排除vendors
目录,问题是我无法在特定的类上进行挖掘,也无法使用与供应商文件夹中的类相关的建议.
A solution I have tried is to exclude the vendors
directory from the project, the problem is I can't dig anymore on a specific class nor use the suggestions associated with classes in the vendors` folder.
有人遇到过同样的问题吗?
Has anyone faced the same issue ?
推荐答案
您目前唯一的选择就是做您要做的事情-从vendors
目录中排除文件夹.您只需要做一些不同的事情-您仍然需要引用它...
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...
- 不排除整个文件夹,而是排除特定的子文件夹(例如
vendors/symfony
) - 通过包含路径(
Settings (Preferences on Mac) | Languages & Frameworks | PHP
)重新添加此类文件夹
- Instead of excluding the whole folder, exclude specific subfolders (e.g.
vendors/symfony
) - Add such folder back via Include Paths (
Settings (Preferences on Mac) | Languages & Frameworks | PHP
)
从理论上讲-排除整个vendor
文件夹,然后通过包含路径"将其重新添加也可以..但是我更希望控制得更好一些,并且可以在单个包装/供应商级别进行.
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.
此外,Composer集成的功能基本相同(如果启用了此选项),但将在实际的包装级别(vendors/symfony/symfony
)上执行,而不是在此处建议的较高的供应商级别(vendors/symfony
).
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.
如果您使用的是Composer ...仅启用该选项就足够了(当然,您需要在composer.json
上方提供路径)
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)
这篇关于PhpStorm-从"ctrl + shift + n"目录中排除目录命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!