NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Insight on Globals from another file


Joined: 23 Mar 2005
Posts: 21
Reply with quote
Code Insight and completion has improved a lot in version 4 and the "find declaration" in 4.0.1 is something I had been dreaming of since day 1 I used PhpEd. Very nice! Smile

There is still a little feature that I'm missing badly: easy code completion / find declaration on global variables defined in another file.

I know you like code samples, so here is a small one (I am using PHP 4):

inc.php:
Code:

class Y
{
  var $X;
}

$Y = & new Y();


main.php:
Code:

include("inc.php");

$Y->


PhpEd says it fails to find type of variable Y. So I need to do this instead:
main.php:
Code:

include("inc.php");

/**
 * @var Y
 */
global $Y;

$Y->


At that point it works, but redeclaring all globals in all files is pretty tedious... Would it be possible for PhpEd to check all declarations on $Y throughout the project and if they all resolve to the same Type (which is almost always the case), use that Type? That would be so incredibly useful.

Thanks Smile

_________________
- François PLANQUE
View user's profileFind all posts by fplanqueSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Thanks.
This feature is implemented in PHPED v4.0.1, build 4049 which is currently under betatesting.
If everyting goes right, we'll release it in a week or less.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 23 Mar 2005
Posts: 21
Reply with quote
Excellent! Thanks Smile

_________________
- François PLANQUE
View user's profileFind all posts by fplanqueSend private messageVisit poster's website
Code Insight on Globals from another file
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