简体   繁体   English

PHPStorm命名空间支持不适用于Symfony2项目

[英]PHPStorm Namespace support not working for Symfony2 projects

I'm evaluating PHPStorm right now, and I've really grown fond of it. 我现在正在评估PHPStorm,我真的很喜欢它。 It's fast, has more or less everything perfectly implemented and the flow flows like a breeze... 它速度快,或多或少都完美实现,流程轻而易举......

The only thing bugging me (and that's a big one) is, that it doesn't seem to get the namespaces for my symfony2 project right. 唯一让我烦恼的事(那是一个很大的问题)是,它似乎没有为我的symfony2项目获得名称空间。

See, in Netbeans, when I type use Symf[CTRL+SPACE] it show me all the Symfony namespaces, right out of the /vendors folder. 在Netbeans中,当我输入use Symf[CTRL+SPACE]它会显示所有Symfony名称空间,就在/vendors文件夹中。

If I do the same in PHPStorm, no namesapces are shown. 如果我在PHPStorm中执行相同操作,则不会显示任何名称。 That means that the whole code copletion doesn't work for the vendor libraries, which is really very, very bad in terms of easy and fast programming. 这意味着整个代码的完全不适用于供应商库,这在简单快速的编程方面非常非常糟糕。

Now, I'm quite sure that I'm just missing a setting somewhere, but I just can't find it. 现在,我很确定我在某个地方错过了一个设置,但我找不到它。

The Question is a bit old, but if anyone stumbles across it (like me) and still nothing works, it might be because your vendor folder gets excluded from code inspection. 问题有点陈旧,但是如果有人偶然发现它(像我一样)并且仍然无效,那可能是因为您的供应商文件夹被排除在代码检查之外。

You have to go to "File -> Settings -> Directories" and set the vendor folder to be a resource root and not be excluded. 您必须转到“文件 - >设置 - >目录”并将供应商文件夹设置为资源根目录,而不是排除。

More info here: Jetbrains Namespaces 更多信息: Jetbrains命名空间

这不再是一个问题,有一个Symfony插件现在大部分时间都可以工作。

看起来像PhpStorm中已知问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM