Home » Language IDEs » PHP Development Tools (PDT) » PDT Code Assist
PDT Code Assist [message #99021] |
Thu, 25 June 2009 10:13  |
Eclipse User |
|
|
|
I'm a complete newbie to PHP and PDT, so please forgive my ignorance in
advance.
I installed Galileo and PDT yesterday, and started working through a
couple of the beginner tutorials in PDT Help. A couple of minor things
occurred.
1) I noticed that when I created a new PHP Page (file>new>PHP file)the
code page that was created lacked the closing ?> markup. Is that normal?
2) Code assist only works when I press CTL-space. I followed the help
instructions, and verified that window>preferences>PHP>editor>Code Assist
had the Enable auto activation box was checked. Actually, I still had
Ganymede files installed, so I fired it up, and it has the same behavior,
although it did add the closing ?> that I mentioned in #!.
These are minor issues, but obviously I'd like to have all the
functionality operable. Thanks, in advance, for your help, and also if
you know of any good beginner resources, I'd be happy to hear about them.
ftc
|
|
| |
Re: PDT Code Assist [message #99066 is a reply to message #99021] |
Thu, 25 June 2009 10:51   |
Eclipse User |
|
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/25/2009 10:13 PM, Frank wrote:
> I'm a complete newbie to PHP and PDT, so please forgive my ignorance in
> advance.
>
> I installed Galileo and PDT yesterday, and started working through a
> couple of the beginner tutorials in PDT Help. A couple of minor things
> occurred.
>
> 1) I noticed that when I created a new PHP Page (file>new>PHP file)the
> code page that was created lacked the closing ?> markup. Is that normal?
>
> 2) Code assist only works when I press CTL-space. I followed the help
> instructions, and verified that window>preferences>PHP>editor>Code
> Assist had the Enable auto activation box was checked. Actually, I
> still had Ganymede files installed, so I fired it up, and it has the
> same behavior, although it did add the closing ?> that I mentioned in #!.
>
> These are minor issues, but obviously I'd like to have all the
> functionality operable. Thanks, in advance, for your help, and also if
> you know of any good beginner resources, I'd be happy to hear about them.
>
> ftc
>
Frank,
1) PHP does not require a closing "?>" on scripts. Execution will end
without a problem upon the end of a file. In fact, the Zend Framework
coding guidelines recommend leaving-off the closing "?>" if you do not
intend anything after the PHP portion of a script, as that will also
ensure there aren't any erroneous whitespace characters, which can wreak
havoc with scripts that output arbitrary data, such as a download
script. Unintended trailing whitespace is a culprit in many a broken
script.
PDT, therefore, does this intentionally.
Hopefully someone with more than just trivial knowledge can answer #2
for you. ;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkpDju4ACgkQaVgOCFr0s2I8lgCdE58+v/dEAEPTu11B34Ky 5D4z
j54An0lNfAf/jXWd8jVMihrouDjy6a8S
=uVey
-----END PGP SIGNATURE-----
|
|
| | |
Re: PDT Code Assist [message #99192 is a reply to message #99052] |
Sat, 27 June 2009 07:49   |
Eclipse User |
|
|
|
On 25.6.2009 17:32, Exception e wrote:
Thanks for this, eclipse 2.1 hangs every time when typing $ char.
So i removed it from autocompletion trigger characters and now i can "use" PDT again.
>
>> 1) I noticed that when I created a new PHP Page (file>new>PHP file)the
>> code page that was created lacked the closing ?> markup. Is that normal?
>
> Yep, not closing a file with ?> is actually recommended.
>
>> 2) Code assist only works when I press CTL-space. I followed the help
>> instructions, and verified that window>preferences>PHP>editor>Code
>> Assist had the Enable auto activation box was checked. Actually, I
>> still had Ganymede files installed, so I fired it up, and it has the
>> same behavior, although it did add the closing ?> that I mentioned in #!.
>>
> You are right that autocompletion is a bit Spartan.
> In comparison to Visual Studio you need to hit the keyboard very often
> to trigger autocompletion. Eclipse/pdt does litte to follow you with
> advise.
>
> You can see in window>preferences>PHP>editor>Code Assist that there are
> autocompletion trigger characters. Only when you enter these characters,
> autocompletion pops up. Code assist will also be there if you type "new "
>
>
> Code assist is thus very limited. To improve this situation I would
> suggest heading over to this bug report and add your vote:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=204768
|
|
| | | | | |
Re: PDT Code Assist [message #99425 is a reply to message #99396] |
Tue, 30 June 2009 11:17   |
Eclipse User |
|
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/30/2009 10:19 PM, Ernesto Baschny [cron IT] wrote:
> sNop wrote: on 30.06.2009 12:05:
>
>>> | Yep, not closing a file with ?> is actually recommended.
>>>
>>> Where do you see this recommended?
>> e.g. here:
>> http://framework.zend.com/manual/en/coding-standard.php-file -formatting.html#coding-standard.php-file-formatting.general
>
> To me that is a nonesense recommendation.
>
> You could as well define in your coding guidelines that "no empty lines
> are permitted after the closing ?>". How should that "inject trailing
> white space into the response"???
>
> Cheers,
> Ernesto
One advantage would be that, as a recommendation, it would work in all
editors. Some (poorly-designed) editors don't give the coder complete
control over their editing, and thus, sometimes add whitespace
characters when they try to "help" him. By leaving-out the closing tag
at the end of the file, even this is worked around.
I cannot speak for the framers of the Zend Framework coding
recommendations, but I like this particular recommendation, and follow
it myself, and I am sure there are other reasons to do so as well.
The fact that it's perfectly valid PHP markup should really make it a
non-issue. It's just the default PHP template in PDT, which was written
with the Zend Framework in mind.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkpKLIQACgkQaVgOCFr0s2JtqgCgmhZsOcQqbiWwBF/VwezG L0gg
VRgAoKKwc//Rfg5L5Cr4DPIUGaqKJe0/
=OXWR
-----END PGP SIGNATURE-----
|
|
| | |
Re: PDT Code Assist [message #99477 is a reply to message #99451] |
Wed, 01 July 2009 07:02   |
Eclipse User |
|
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/01/2009 05:24 PM, Michael Madsen wrote:
> That is not an advantage but a quickfix for a problem elsewhere. Look at
> IE, a poorly designed browser for which we have to make hacks and what
> not. The problem is IE, not that hacks aer hard to implement and
> timeconsuming. As I stated in another reply here, this recommendation is
> only for when the zend framework is used and NOT for normal php
> development. Making quickfixes to cover up bad coding style and/or
> discipline does not justify them.
>
>> The fact that it's perfectly valid PHP markup should really make it a
>> non-issue.
>
> Good programming experience tells us not to relay too heavily on
> language defaults as they can change over time or introduce issues. Just
> because we can, doesn't mean we should.
It's also documented within the PHP manual here:
http://www.php.net/manual/en/language.basic-syntax.instructi on-separation.php
I don't want to drive the point, but you are equating it with bad
programming style, whereas I disagree and see it as fine. I think part
of the advantage for me is that I do *not* mix PHP & non-PHP (e.g.,
HTML) code output. I do everything from within PHP, so my PHP files are
all PHP code, and do not enter and escape from HTML. I do this for
consistency purposes, and therefore, I have no need to use the closing
PHP tags. So, it fits in well with my style.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkpLQlMACgkQaVgOCFr0s2LSMACgsBhZRvuo50s2B2Bqr8px mLaX
34IAnitDHUmFh4JQlmn6KdP7TY4u2INB
=AJja
-----END PGP SIGNATURE-----
|
|
| | |
Re: PDT Code Assist [message #99702 is a reply to message #99021] |
Mon, 06 July 2009 15:27  |
Eclipse User |
|
|
|
Hi,
I experience something strange with code assist in 2.1.
It is working fine at root level in a php file,
but if start a function, inside the function it does not work
for global variables ($GLOBALS, $_REQUEST, etc.).
It works only for variables defined inside the function.
Is this intentional, or is there a preferences setting for it?
Thanks,
Andras J.
|
|
|
Goto Forum:
Current Time: Tue Jul 15 05:23:38 EDT 2025
Powered by FUDForum. Page generated in 0.16038 seconds
|