简体   繁体   English

Eclipse PDT代码有助于不识别变量的对象分配

[英]Eclipse PDT code assist not recognizing object assignments to variables

For some reason, Eclipse's code assist stopped working for variables that are assigned objects. 由于某种原因,Eclipse的代码辅助功能停止了为分配了对象的变量工作。

For instance 例如

// This returns a Model_Item object
$item = Model_Item::factory($id);

// Or this
$item = new Model_Item();

Now if you try to access the autocomplete 现在,如果您尝试访问自动完成功能

// Says there are no default proposals
$acct = $item->{ctrl+space}

However, if you do 但是,如果您这样做

// This works as expected
Model_Item::factory($id)->{ctrl+space}

Also, when I hover over $item, it doesn't tell me that it is a Model_Item. 另外,当我将鼠标悬停在$ item上时,它不会告诉我它是Model_Item。

Has anyone come across this before and figured out how to get it to work? 之前有没有人遇到过这个问题,并想出了如何使其正常工作的方法?

EDIT: 编辑:

Looks like it's a bug. 看起来是个错误。 I can get it to work if I do this: 如果这样做,我可以使其正常工作:

$item = new Foo();
// No work here
$acct = $item->bar;
// But now it will work
$item->baz();

Not sure why this is this way... 不知道为什么会这样...

This is more than likely a bug. 这很可能是一个错误。 You should go to Eclipse's bug tracker and first search to see if this bug has already been reported. 您应该转到Eclipse的错误跟踪器,并首先搜索以查看是否已经报告了该错误。 If this bug has not been reported, then you should report it yourself if you wish to see it fixed. 如果尚未报告此错误,则如果希望修复此错误,应自行报告。 I did a quick search to see if I could find the bug, however nothing appeared to match the description, so you should probably go ahead and report the bug. 我进行了快速搜索以查看是否可以找到该错误,但是没有发现与描述相符的内容,因此您应该继续进行报告。

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

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