Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Code Assist (suggests)
Code Assist (suggests) [message #66220] Tue, 19 February 2008 18:23 Go to next message
Petr is currently offline PetrFriend
Messages: 11
Registered: July 2009
Junior Member
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Petr is currently offline PetrFriend
Messages: 11
Registered: July 2009
Junior Member
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 :)
Previous Topic:Small code formatting question
Next Topic:PDT and Eclipse 3.4
Goto Forum:
  


Current Time: Sat Dec 21 15:07:37 GMT 2024

Powered by FUDForum. Page generated in 0.03617 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top