Eclipse完成 - @var(PHPDoc)问题 [英] Eclipse completions - @var (PHPDoc) question

查看:149
本文介绍了Eclipse完成 - @var(PHPDoc)问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有奇怪的问题。



当我在模型加载中使用 @return Model\Article 方法,然后在Eclipse的自动完成中看到模型的方法。



模型加载方法返回更多的对象,所以我想要它 @return My\\ \\ BaseModel ,然后为每个模型特定(当我使用它)时,将 / * @var $ model Model\Article * / / p>

问题是 @return Model \Article 的效果很好(我看到 Model \Article + My\BaseModel 方法),但另一种方式( @return My\BaseModel 和inline /*...*/ )不 - 这表示'没有完成''。



我试图在 $ model = ...; 之前和之后放置内联评论,但没有工作。 >

我很抱歉我的不好的英语 - 我希望你明白。



谢谢你的任何帮助,最好的REGA rds,JakubChábek。

解决方案

Chronial:我们做错了...


$ b $所有:这里是同样的问题的bug报告,但它是解决的 - 我尝试了它,它的工作原理



这里是工作示例:

 命名空间测试{
class AAA {

/ **
*
* @return \test\AAA
* /
static function getInstance(){
return new static();
}
}
}
命名空间test2 {
class BBB extends \test\AAA {
/ **
*
* @return \test2\BBB
* /
function showme(){
}
}
}

命名空间test3 {
$ aaa = \test2\BBB :: getInstance();
/ * @var $ aaa \test2\BBB * /
$ aaa->
}

所以在我身边一定有一个错误,但不能真的找到它:D


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.

解决方案

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:

namespace test {
    class AAA {

        /**
         * 
         * @return \test\AAA
         */
        static function getInstance() {
            return new static ();
        }
    }
}
namespace test2 {
    class BBB extends \test\AAA {
        /**
         * 
         * @return \test2\BBB
         */
        function showme() {
        }
    }
}

namespace test3 {
    $aaa = \test2\BBB::getInstance ();
    /* @var $aaa \test2\BBB */
    $aaa->
}

So there must be an misstake on my side ... but can't really find it :D

这篇关于Eclipse完成 - @var(PHPDoc)问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆