NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Completion for Project, Code Snippet, Search ...


Joined: 21 Oct 2004
Posts: 3
Reply with quote
Hi,

We are in the process of finalizing our evaluation of PHP editors and PHPEd is our top contender but would like to know if the following are in place:

1) Code Completion for Project - I read that version 3.3.2, if included path is specify in Project property, all the files traversing the include path would be part of the code completion list. I'm using version 3.3.3 trial, am not sure why that's the not the case.

2) Code Snippet - I know there's code template but for someone who's been using HomeSite for a while, code snippet makes my coding so much faster because each time I have a nice piece of code written, I can immediately add that to my code snippet library.

3) Search in Code Explorer - Right now my php project consists of about 200 functions, and would like the ability to do function search in Code Explorer.

4) Understands "public function blah()" as function in Code Explorer.

Thanks!
View user's profileFind all posts by newyenSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
Thanks for your comments.

Quote:
1) Code Completion for Project - I read that version 3.3.2, if included path is specify in Project property, all the files traversing the include path would be part of the code completion list. I'm using version 3.3.3 trial, am not sure why that's the not the case.

It is the case. Let me know if you get a particular problem with that. A code sample(s) that won't work would be highly appreciated.

Quote:
2) Code Snippet - I know there's code template but for someone who's been using HomeSite for a while, code snippet makes my coding so much faster because each time I have a nice piece of code written, I can immediately add that to my code snippet library.

Yep, no doubts. This feature is already in our TODO lists.

Quote:
3) Search in Code Explorer - Right now my php project consists of about 200 functions, and would like the ability to do function search in Code Explorer.

Will be done the same way as it works in Workspace (incremental search).

Quote:
4) Understands "public function blah()" as function in Code Explorer.
It's php5 syntax and will be supported by Code Explorer & Code Completion in the next version.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Oct 2004
Posts: 3
Reply with quote
"It is the case. Let me know if you get a particular problem with that. A code sample(s) that won't work would be highly appreciated. "

My PHPEd version is 3.3.3 (Build 3391 eval) running on Windows XP Pro. I included the entire project; not one function was part of the code completion list. Code Explorer found all of the functions, and list them for me.

Thanks!

BTW your reply to my questions is amazingly fast!
View user's profileFind all posts by newyenSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
ahh, surely code completion is smart enough to no waste the space with the full list. If you need a particular function(s) or class(se) to be shown you have to include corresponding file in your source. For example if you have function myFunc defined in myfile.php and you need myFunc to be shown when you edit myfile2.php you have to have include("myfile.php") or require("myfile") appeared somewhere in myfile2.php... otherwise php engine itself won't find the function too...
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 04 Jun 2004
Posts: 9
Reply with quote
ddmitrie wrote:
ahh, surely code completion is smart enough to no waste the space with the full list. If you need a particular function(s) or class(se) to be shown you have to include corresponding file in your source.


Why is this smart? This is the way Zend handles things and it works pretty well.

At anytime, working in any given file the project knows that when I call,

$mail = new Mailer();

$mail->(I get a list of functions and variables)..

Any chance this will be revisted? This is a show killer for me. PHPEd > Debugging than Zend.. But Zend is more user friendly when working with large projects..


Code explorer doesn't due the trick when there is a few hundred classes/functions listed..
View user's profileFind all posts by lagsalotSend private messageYahoo Messenger


Joined: 04 Jun 2004
Posts: 9
Reply with quote
And actually.. From this thread it looks like it should.. code-insight-when-using-require-once-var-t952.html

However now its stated again that it does not work that way.

Can I get some clarifacation as this is the only thing preventing me from going ahead with the PO.


PS.. The last version I evaluated was 3.3.2 - 3386Eval and the functionality was still not present.
View user's profileFind all posts by lagsalotSend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
Fine. Let's go deeper.
Please first post the code sample that replicates the "problem".
I think just $mail = new Mailer(); and corresponding include() will be sufficient.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 04 Jun 2004
Posts: 9
Reply with quote
Well the "include" is the problem. These classes and functions are in the project, yet they are included from another file.

Here is some screen shots from Zend.



Above we have a fresh project and a blank new file. With out having to have includes or requires called, Zend knows that the obj exists within the project and allows code insight.


And the methods and members for that called function..





Now in PHPEd, the include statement is required in EVERY file, for any class or object you are referencing if you want code insight to work.

Also, if you use a config and set something like..

define("CLASS_PATH", "/project/includes/classes");

And then in your PHPEd file you use..

include(CLASS_PATH."/my_class.php");

You will also not get any code insight...



Like I stated, for small projects this isn't a big concern. But when you are working with a few hundred classes and many files for a single page load, this becomes troublesome because you are constantly switching files to view the arguments for a class or function. Also spending time looking for the name of a certain class.. Sad

This is really my only issue with an otherwise great IDE.
View user's profileFind all posts by lagsalotSend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
What's the advantage to show classes that are not really available at this context and will produce run-time error ?

Quote:
Also, if you use a config and set something like..
define("CLASS_PATH", "/project/includes/classes");
And then in your PHPEd file you use..
include(CLASS_PATH."/my_class.php");
You will also not get any code insight...


Not really.
my_class.php will be found in the project and used. If it is beyound the project root directory you have to include its directory to Include Path setting in the project properties. No problems so far, isn't it ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 04 Jun 2004
Posts: 9
Reply with quote
Well in the project I'm currently working on for example, the class that manages sessions is used through out the project, but is loaded by the index page.

All the index page does is read in the config, load the required classes, setup the db connection, permissions and such. Then based on other paramaters will include what ever other modules/pages/forms.

This is done specifically so that I don't have to include these management classes on every page.

So the class is available, although it wouldn't appear to be if you looked at this single file.

--

Its no huge deal.. If this is not a behavoir you would like to include I can understand, as I can see both sides of the situation.
View user's profileFind all posts by lagsalotSend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 7857
Reply with quote
I think the best solution is to have one option that will turn on/off "globbing" the classes, methods and functions. So when it is on you see all the classes regardless of include statement is there or not. Actually it will even speed up the code completion...
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 19 Nov 2004
Posts: 1
Reply with quote
yeah.. I have the same complaint about the code completion, and I abstain of using of PhpEd because of this. The last sugestion about turning on/off "globbing" of completions is great... I suppose that it is easy to implement.

PS: I have absolutely the same situation like lagsalot. My index includes needed files with functions, then includes content pages, in which I am using functions from files included in index. In content pages I have not explicit include statement, but i need to see defined functions.
View user's profileFind all posts by HmmmSend private messageICQ Number
Code Completion for Project, Code Snippet, Search ...
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic