[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.pdt] Re: auto completion on "static" classes

Micah schrieb:
> Nikolai Plath wrote:
>> Hello,
>> i am a frequent newsgroup reader, but not a frequent writer.
>>
>> I have a simple question on a simple problem... at least in my personal
>> opinion.
>>
>> The problem is about auto completion on so called "static" classes.
>>
>> "Project" layout:
>>
>> project
>>   |--static.php
>>   |--test.php
>>
>> static.php
>> --------------
>> class theStaticClass
>> {
>> 	/**
>> 	 * My lil test
>> 	 *
>> 	 * @return void
>> 	 */
>> 	function theStaticMethod()
>> 	{
>> 		echo 'dummy';
>> 	}
>> }
>>
>> test.php
>> --------------
>> the	+Ctrl SPC expands to
>> theStaticClass::
>> theStaticClass::the	+Ctrl SPC -> no completions available
>>
>> typing by hand:
>> theStaticClass::theStaticMethod();
>> on mouse hover gives me full information of class AND method in
>> tooltip... ???
>>
>> just trying:
>> $s = new the	+Ctrl SPC expands to
>> $s = new theStaticClass();
>>
>> $s->	tooltip shows inmediately the available method...
>>
>> --------
>>
>> So this is why I still use PDT 1.0.3 for my everyday/night work where AC
>> on static classes works exeptionally well.
>>
>> Currently I am working on some Joomla! projects (http://joomla.org)
>> which uses static classes all over the place for translation and HTML
>> output.
>>
>> I have tried a lot of PDT 2 releases from nightly over I/M to so called
>> "stable"...sry
>>
>> The good news is that mark occurences is getting better and better -
>> this one makes me switching "back" from time to time to PHPEclipse when
>> I have to deal with extraneous code - please keep working on this one -
>> it's pretty useful ;)
>>
>> Memory consumption on debugging also semms to be ok now.
>>
>> But - sorry - auto completion, in my very personal opinion (maybe), is
>> one of the most important features.
>>
>> So I can not vote +1 as a happy PDT 2 user - but I am still a very happy
>> PDT 1 user :)
>>
>> But hey - maybe the problem, as usual, is on my side and i am doing
>> something terribly wrong. So please foregive me - teach me - and you
>> will have another happy PDT 2 user.
>>
>> Regards,
>> Nikolai
>>
>> PS: not sure if this could be OS related - i am on Linux :)
> 
> Which version of PHP are you using?  If you're using 5, I suggest
> reading the manual on how to declare static functions:
> http://us3.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
> 
> If you're using PHP4, you might have to tell Eclipse that you are doing
> so in the PHP settings.
> 
> Micah

Thanks for pointing this out. After declaring the method in my little
example as static, cc worked as expected.
On the other hand, removing the static keyword and switching PHP
settings to 4 & full rebuild did not do the trick.

I am using PHP 5 but lots of code is kept without access modifiers for
backward compatibility.

So, i will have no code assist for static methods which are not declared
properly - thanks a lot, good to know.

Nikolai