Eclipse 完成 - @var (PHPDoc) 问题
我有奇怪的问题。
当我在模型加载方法中使用 @return Model\Article
时,我会在 Eclipse 的自动完成中看到模型的方法。
模型加载方法返回更多对象,因此我希望它 @return My\BaseModel
,然后为每个模型放置 /* @var $model Model\Article */
具体来说(当我使用它时)。
问题是 @return Model\Article
工作得很好(我看到 Model\Article
+ My\BaseModel
方法),但另一种方式( @return My\BaseModel
和内联 /*...*/
) 没有 - 它说“没有可用的完成”。
我尝试在 $model = ...;
之前和之后放置内联注释,但都不起作用。
我很抱歉我的英语不好 - 我希望你能理解。
感谢您提供的任何帮助,最诚挚的问候,Jakub Chábek。
I have strange problem.
When I use @return Model\Article
in the model-loading method then I see the model's methods in autocomplete of Eclipse.
The model-loading method returns more objects so I want it to @return My\BaseModel
and then put the /* @var $model Model\Article */
for each model specificaly (when I use it).
The problem is that the @return Model\Article
works well (I see Model\Article
+ My\BaseModel
methods) but the other way (@return My\BaseModel
and inline /*...*/
) doesn't - it say's 'No completions available'.
I tried to place the inline comment before and after the $model = ...;
, but neither worked.
I'm sorry for my bad English - I hope you understand.
Thank you for any kind of help, best regards, Jakub Chábek.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Chronial:我们做错了什么...
全部:这是具有相同问题的错误报告,但它已解决 - 我尝试过,它有效!
这是工作示例:
所以我这边一定有一个错误......但无法真正找到它:D
Chronial: we did something wrong ...
All: here is bug report with same problem, but it is solved - I tried it and it works!
Here is working example:
So there must be an misstake on my side ... but can't really find it :D
我以前也遇到过这个问题。从未找到简单且干净的解决方案。当您确实迫切需要代码完成时,请将赋值放在永远无法到达的位置:
Eclipse 将不会意识到该代码永远不会被执行,并为您提供适当的代码完成。
I've had problems with that before, too. Never found an easy and clean solution. When you are really desperate for code-completion, place an assignment at a position that will never be reached:
Eclipse will not realize that this code will never be executed and give you the appropriate code-completion.