Skip to main content



      Home
Home » Language IDEs » PHP Development Tools (PDT) » Calling code assist without class name
Calling code assist without class name [message #33561] Wed, 04 July 2007 12:12 Go to next message
Eclipse UserFriend
Originally posted by: dartar.wikkawiki.org

It appears that the only way to have code assist use methods from a given
class in a distinct file of the project is to prepend the full class name,
e.g. $MyClass->MyMethod();

I assumed that method-, variable- and constant-names were picked up by
code assist regardless of the class in which they are declared, so that
for instance I could use $this->Met... to display a list of options.
Actually most calls to core methods in our project are done via $this so
code assist will probably be useless here, is that correct?

Best,
Dario
Re: Calling code assist without class name [message #33595 is a reply to message #33561] Wed, 04 July 2007 12:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: omry.yadan.net

did you try Met<ctrl+space> ?


Dario Taraborelli wrote:
> It appears that the only way to have code assist use methods from a
> given class in a distinct file of the project is to prepend the full
> class name, e.g. $MyClass->MyMethod();
>
> I assumed that method-, variable- and constant-names were picked up by
> code assist regardless of the class in which they are declared, so that
> for instance I could use $this->Met... to display a list of options.
> Actually most calls to core methods in our project are done via $this so
> code assist will probably be useless here, is that correct?
>
> Best,
> Dario
>
>
Re: Calling code assist without class name [message #33629 is a reply to message #33595] Wed, 04 July 2007 12:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dartar.wikkawiki.org

Omry Yadan wrote:

> did you try Met<ctrl+space> ?

yep, and nothing happens.

If I type $wakka->Met a list of methods starting with "Met" and declared
in class wakka is automatically displayed (together with the correct
phpdoc description). With $this->Met or $this->Met<ctrl+space> or just
Met<ctrl+space> nothing happens.

The same issue applies to hover help. Hovering over $wakka->Method()
displays Method()'s documentation but nothing happens hovering over
$this->Method() or just Method().

By the way, it would be great to have the ability to browse a master list
of methods, variables and constants in the PHP Project Outline regardless
of the class in which they are declared, i.e. have the option to toggle
between hierarchical view (top -> classes -> MyClass -> MyMethod) and flat
view (top -> functions -> MyMethod[MyClass]).

d
Re: Calling code assist without class name [message #33661 is a reply to message #33561] Thu, 05 July 2007 06:41 Go to previous messageGo to next message
Eclipse UserFriend
Dario Taraborelli wrote:
> I assumed that method-, variable- and constant-names were picked up by
> code assist regardless of the class in which they are declared, so that
> for instance I could use $this->Met... to display a list of options.
> Actually most calls to core methods in our project are done via $this so
> code assist will probably be useless here, is that correct?

I don't get it.
I use 1.0M1 on 3.3 final (both Ubuntu Feisty and Windows XP) and I have
got code assist perfectly working with $this variable.

Of course it proposes only method names defined in a class to which the
method you are in belongs. So if you have 2 classes defined and are
inside a method of "class1" you see only its methods and fields proposed
after $this-> and not methods belonging to "class2". I think it is
actually the best way that this feature can work.

Best regards,
Piotr Szczepanik
Re: Calling code assist without class name [message #33695 is a reply to message #33661] Thu, 05 July 2007 07:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dartar.wikkawiki.org

OK, I tried to type $this->... *within* a class MyClass and code assist
works fine.

The problem is that most of our code is stored in plugin files that are
called via an Action() method defined in the main class. These plugins can
use any of the methods defined in the MyClass class via $this->AnyMethod()
but there's apparently no way to tell code assist that these calls fall
within an instance of MyClass. So, when I'm editing a plugin, whereas
$MyClass->... and MyClass::... both trigger the code assist, there's no
way to evoke it typing $this->...

I wonder if this makes my issue any clearer.

d
Re: Calling code assist without class name [message #33797 is a reply to message #33695] Thu, 05 July 2007 10:55 Go to previous message
Eclipse UserFriend
Dario Taraborelli wrote:
> The problem is that most of our code is stored in plugin files that are
> called via an Action() method defined in the main class. These plugins
> can use any of the methods defined in the MyClass class via
> $this->AnyMethod() but there's apparently no way to tell code assist
Do you do it with method overloading (__call())?


Best regards,
Piotr Szczepanik
Previous Topic:PDT on 64bit linux machine
Next Topic:best method for deploying/uploading project
Goto Forum:
  


Current Time: Sun Jul 13 17:40:43 EDT 2025

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

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

Back to the top