Codecompletion `broken in 5989? |
Guru master
|
I'm assuming the Datastore is a class that return items of type Product class.
If that is the case, then this works in my 5989:
Put your cursor after $Product-> and you should get code completion. The @var immediately precedes the first assignment of the $Product variable and specifies the datatype (in this case it is a class name). Any text after the datatype is a human readable description and not parsed by PhpED. In my example $Datastore does not require an @var because PhpED recognises new Datastore() and knows the variable type from that. If this doesn't help, please share a little more information about the structure of your classes and exactly where you want to get code completion. |
||||||||||||||
|
|
Thanks for your help but it still wont work for me. Here is another simple example of what doesnt work for me.
file class.Product.php: class Product{ } file index.php /** @var Product $prod */ $prod = $Datastore->getProduct(); The way this worked earlier was that the PHPDoc syntax preceded everything else and did just look at the $prod as a type of Product, but now it will only give me a $prod unknown type. thanks |
||||||||||||
|
Guru master
|
Your example works in my 5989, although I did add a function so that it would popup with something in code completion:
file class.Product.php:
file index.php
Does class.Product.php appear in the Code Explorer panel? Maybe try doing a refresh in the Code Explorer panel to see if that helps? The new 5990 is supposed to help with some Code Completion issue, but I'm not sure it would help this. |
||||||||||||||||
|
|
Thanks for your help. I did find out what was my problem. It seems like PHPEd has gotten much stricter on the PHPDoc return types than earlier. I had an abstract class Datastore that was set to return a "mixed" type and that one apearantly messed up my code completion.
Earlier I could override these return types with just redefining the type of the variable where I wanted too but that doesnt seem possible now, so I guess I have to start commenting my classes and functions better |
||||||||||||
|
Codecompletion `broken in 5989? |
|
||
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