Code Assist (suggests) [message #66220] |
Tue, 19 February 2008 18:23  |
Eclipse User |
|
|
|
Hi
Is there a way to tell eclipse that variable of class is actually an
object of other class so code completion assistant can suggest methods?
I guess the best way to explain what I'm referring to is an example:
class Foo {
/**
* @var object
*/
public $subClass;
public function __construct() {
$subClass = new subFoo();
}
// ...
}
class subFoo {
public function foo() {
// ...
}
// ...
}
$foo = new Foo();
$foo->subClass->foo();
Now when I use $foo->subClass eclipse code completion assistant is not
suggesting anything to me. Is there a way to tell Eclipse that the
$foo->subClass is object of class subFoo?
Petr
|
|
|
Re: Code Assist (suggests) [message #66244 is a reply to message #66220] |
Tue, 19 February 2008 20:11   |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.mark-kirchner.de
Hi,
Petr schrieb:
> Is there a way to tell eclipse that variable of class is actually an
> object of other class so code completion assistant can suggest methods?
Yes, (in your example) just use this:
[...]
class Foo {
/**
* @var subFoo
*/
public $subClass;
[...]
HTH,
Mark
|
|
|
Re: Code Assist (suggests) [message #66266 is a reply to message #66244] |
Wed, 20 February 2008 09:49  |
Eclipse User |
|
|
|
Mark Kirchner napsal(a):
> Hi,
>
> Petr schrieb:
>> Is there a way to tell eclipse that variable of class is actually an
>> object of other class so code completion assistant can suggest methods?
>
> Yes, (in your example) just use this:
>
> [...]
> class Foo {
> /**
> * @var subFoo
> */
> public $subClass;
> [...]
>
> HTH,
> Mark
Thank you very much. It's OK :)
|
|
|
Powered by
FUDForum. Page generated in 0.24893 seconds