Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Code completion
Code completion [message #1005263] Thu, 24 January 2013 18:36 Go to next message
Denis Shmakov is currently offline Denis ShmakovFriend
Messages: 5
Registered: January 2013
Junior Member
I have class

class MyClass
{
function MyFunc()
{
$s = 'asd';
return s;
}
}

write
$c1 = new MyClass();
$c1-> press Ctrl+space and see MyFunc

All right! Next.
write
$c2 = MyClass:: press Ctrl+space and not see function in class!

Why? How can i see class functions in direct call but not as object call?
Re: Code completion [message #1005377 is a reply to message #1005263] Fri, 25 January 2013 07:51 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
>$c2 = MyClass:: press Ctrl+space and not see function in class!
In this context, after ::, pdt proposes static methods/variables only.
Re: Code completion [message #1005378 is a reply to message #1005377] Fri, 25 January 2013 08:04 Go to previous messageGo to next message
Denis Shmakov is currently offline Denis ShmakovFriend
Messages: 5
Registered: January 2013
Junior Member
There are any settings to allow this?
Or plans in future?
It would seem to me it is useful.
Re: Code completion [message #1005428 is a reply to message #1005263] Fri, 25 January 2013 11:54 Go to previous messageGo to next message
sNop is currently offline sNopFriend
Messages: 281
Registered: July 2009
Senior Member
The function have to be declared as static.

Your PHP syntax skills aren't at good level.

class MyClass
{
public static function MyFunc()
{
$s = 'asd';
return s;
}
}

On 24. 1. 2013 22:15, Denis Shmakov wrote:
> I have class
>
> class MyClass
> {
> function MyFunc()
> {
> $s = 'asd';
> return s;
> }
> }
>
> write $c1 = new MyClass();
> $c1-> press Ctrl+space and see MyFunc
>
> All right! Next.
> write
> $c2 = MyClass:: press Ctrl+space and not see function in class!
>
> Why? How can i see class functions in direct call but not as object call?
icon6.gif  Re: Code completion [message #1005510 is a reply to message #1005263] Fri, 25 January 2013 18:58 Go to previous messageGo to next message
Valery Cheban is currently offline Valery ChebanFriend
Messages: 17
Registered: January 2013
Junior Member
Hello!
Or you may use this flag:
PHP - Editor - Content Assist - Show Strict Options (set On)
Enjoy!
Re: Code completion [message #1005529 is a reply to message #1005510] Sat, 26 January 2013 07:10 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
Oh, thanks for the best answer Smile I missed the Preferences.
Re: Code completion [message #1005597 is a reply to message #1005510] Sun, 27 January 2013 04:46 Go to previous messageGo to next message
Denis Shmakov is currently offline Denis ShmakovFriend
Messages: 5
Registered: January 2013
Junior Member
Cheban Valery wrote on Fri, 25 January 2013 13:58
Hello!
Or you may use this flag:
PHP - Editor - Content Assist - Show Strict Options (set On)
Enjoy!


Thank you very much! It's all i need.
Re: Code completion [message #1005598 is a reply to message #1005428] Sun, 27 January 2013 04:51 Go to previous message
Denis Shmakov is currently offline Denis ShmakovFriend
Messages: 5
Registered: January 2013
Junior Member
sNop wrote on Fri, 25 January 2013 06:54

The function have to be declared as static.

Your PHP syntax skills aren't at good level.



I can't modify others module. Sad
There functions not declare as static.
Previous Topic:moving from netbeans to eclipse
Next Topic:Annoying error with "Open Type Hierarchy action"
Goto Forum:
  


Current Time: Fri Mar 29 12:32:54 GMT 2024

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

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

Back to the top