NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Exception objects and Code Completion for them


Joined: 28 Oct 2005
Posts: 6
Reply with quote
I feel a bit bad to be back again in such a short period of time, but I believe that a closer integration of the Exception class and exception handling would be fitting for such an excellent editor for PHP 5 code. PHPEd v4 recognizes by default some PHP 5 classes such as mysqli but does not have Code Completion information for the Exception class. A workaround that I have been using is creating a PHP file that is never included but defines the Exception class as per http://us3.php.net/manual/en/language.exceptions.php. However I think it would be nice if the Code Completion data was built into PHPEd. Another little point is that in try catch blocks, PHPEd does not recognize the caught Exception object as a variable when it displays its Code Completion menu. This also applies to extended Exception objects (i.e. MyException extends Exception). For example:
Code:
try
{
    //something that might throw an Exception
}
catch(Exception $eObj)
{
    $eObj->getCode();
   /*Just typing $e will not show $eObj and I am using a 1 char min limit for Code Completion popups
      Since Code Completion engine doesn't recognize $eObj, all Exception class methods don't show up (even with my workaround)
  */
}


Of course this is not a critical error but I think that this small modification will make PHPEd a better and more efficient IDE for certain projects that are Exception heavy.

David
View user's profileFind all posts by davidloSend private message
Site Admin

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

Quote:
However I think it would be nice if the Code Completion data was built into PHPEd

I think nothing should be built-in. All "pre-defined" functions are actually comming with php extensions and php-core itself. We provide appropriately formed list in func.cfg. So this list should be extended with all necessary info. Yet in its current implementation it supports only functions and does not support classes and their members. It will be improved soon.

Quote:
Another little point is that in try catch blocks, PHPEd does not recognize the caught Exception object as a variable

Regarding code sample, starting with build 4042 phped will recognize $eObj class and therefore will be able to show code completion for it.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Oct 2005
Posts: 6
Reply with quote
It is really nice to know that these features are soon to be implemented Smile. One side question that I have is how do we know when specific builds are released?
David
View user's profileFind all posts by davidloSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
4042 hotfix is already available per request.
Contact support dept. by email or using CONTACT_US page.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Exception objects and Code Completion for them
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 1  

  
  
 Reply to topic