OBJ code completion PHP_Ed vs Zend |
|
It certainly should do that. Go to Tools > Settings > Code Insight, the Code Completion column is what you want. Make sure it's enabled and has a short delay. Try setting "Min characters" to 1. I don't know what that's for, but code completion (for classes at least) only seems to work when it's set to 1. Perhaps someone from Nusphere can clarify this for me?
|
||||||||||||
|
|
ok, i did that, the $OBJ show up .. ie: $_CLA will auto complete to $_CLASS
BUT!!! it still wont autocomplete $_CLASS->method1 method2 method3 method4 ............ arughhh ... hehe Z |
||||||||||||
|
|
phped needs to know how you are including the file. if you include using a variable in the include for example, that is a runtime option and not possible for phped to evaluate it and understand what you want (without also making more bloat).. instead ddmitrie has a great feature -- in project property you explicitly define what gets included and you have an option to turn this on and off in settings as well. the file has to have some 'findable' way in a require/include to automatically work in phped like you are talking about. for instance require($root . '/includes/include1.php'); wouldn't work because phped cannot evaluate the path on it's own without your help using the project property include paths as i just mentioned. |
||||||||||||||
|
Site Admin
|
Actually, this is a problem of 4033. When there is no project in the workspace, it does not offer code completion for user objects. It's been fixed in 4035 and whenever you open a file or files from either remote account or local hard disk, its content is parsed by code completion engine. Also, as Quboid said, PHPED delays autocompletion until at least "MIN CHARACTERS" are typed and its default value is 3. Under "MIN CHARACTERS" we mean number of characters left to cursor up to the closest delimiter or start of the line. In other words it would show drop down if you type ->mym and something like mymethod() exists for current statement. please also see this post http://forum.nusphere.com/tip-type-hints-t1563.html Let me know if you have any further concerns. |
||||||||||||||
|
where to get this new version |
|
i'm a existing customer, and i have the same problem as described.
|
||||||||||||
|
Site Admin
|
If you have 4033, please contact support and get the latest hotfix.
If you have 4035 or higher, please contact support and describe the problem. |
||||||||||||
|
|
I have a similar question (note I'm using the trial version):
I'm using the singleton pattern in my script and I can't get the autocomplete working for my singleton-objects. Eg I have the following code:
However, code completion for $my_A doesn't work, if I type $my_A-> <ctrl-space>, no suggestions are available. Is there a solution for this? thanks |
||||||||||||||
|
|
The problem is rooted in PHP's weakly typed nature... You cannot tell from looking at $my_A only what it is. In your simple case, you can easily guess it from looking at the code, but it's not generally possible.
PHPEd seems to heuristically handle a few cases, e. g. <?php class foo { function bar() {} } $x = new foo(); $x->| ?> where you will get foo::bar as suggestion. A simple modification will already get it wrong: <?php class foo { function bar() {} } class foo2 { function bar2() {} } if (true) $x = new foo(); else $x = new foo2(); $x->| ?> It suggests foo2::bar2 here... You "know" the right answer, but what should PhpED do? Execute the code up to the current spot and find out? But where to start? What if your code has side effects (database queries)? What if the decision for foo or foo2 was not as obvious as above, but based on a random choice? Or, to come back to your question - how should PhpEd know from looking at "get_A()" only that it will always return an instance of A? The same problem applies to class members and function parameters; in these cases, PhpED allows for parsing phpdoc-style comments and provides code completion (relying on correct documentation . Actually, I don't know if it also makes use of PHP5 type hints? Ddmitrie ? With strictly typed languages like C, C++, Java, C#... you don't have these problems because if you find a symbol like "my_A" you can look it up and fill find that it will always be of type "A", so you can provide code completion for it. |
||||||||||||
|
Site Admin
|
Works well in phped build 4042. This hotfix will be available to our customers soon.
type hints work too. Actually they are working in the following order of priorities: -PHPDOC comments (the first b'ze you'd have full control on what you need to be "recognized" in your code) -function/method type-hints -recognized from new and all other lang constructs where class is known. |
||||||||||||||||
|
OBJ code completion PHP_Ed vs Zend |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by