Vscode-intelephense: Autocomplete not working with "@var" declaration

Created on 26 Feb 2019  路  5Comments  路  Source: bmewburn/vscode-intelephense

If you use @var before a variable it will properly show the right type.

/** @var Mage_Customer_Model_Customer */
$customer = Mage::getModel("customer/customer")->load("1");

This will autocomplete the Mage_Core_Model_Abstract class that load returns and not the defined one in @var.

Most helpful comment

Closing, the shorthand syntax is only supported on property declarations.

All 5 comments

If you add the variable name does it work? /** @var Mage_Customer_Model_Customer $customer */

If you add the variable name does it work? /** @var Mage_Customer_Model_Customer $customer */

I test it works.

Okey, so you have to use the explicit variable name and not the short had.
The tool-tip seems to display it correctly even with out the explicit name.

Closing, the shorthand syntax is only supported on property declarations.

Closing, the shorthand syntax is only supported on property declarations.

Sir, maybe this kind of Thing need to be written on the wiki, isn't it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aleksandervines picture aleksandervines  路  3Comments

pseudoanime picture pseudoanime  路  3Comments

ottopic picture ottopic  路  3Comments

dgunay picture dgunay  路  3Comments

9brada6 picture 9brada6  路  3Comments