Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsphp content assist autocompletion help
https://www.eclipse.org/forums/index.php/mv/msg/199126/635205/#msg_635205
autocompletion stops working if i am in a function (with object passed as a parameter) or if my object is stored in a superglobal such as :
$_SESSION['user_db_handler']
i.e.
$smarty = new Smarty();
$smarty-> (this will autocomplete with ctrl-space)
$test_one =& $smarty;
$_SESSION['smarty'] =& $smarty;
$test_one-> (this will autocomplete)
$_SESSION['smarty' ->( this will not autocomplete)
test($smarty);
function test(&$smarty){
$smarty-> (this will not autocomplete)
}
anyone know how i can tell the autocompleter that my $_SESSION['smarty'] or $_SESSION['db'] holds a database object so autocomplete works?
thanks in advance!
]]>Ben K2010-10-26T00:42:40-00:00Re: php content assist autocompletion help
https://www.eclipse.org/forums/index.php/mv/msg/199126/639072/#msg_639072
function test (Smarty &$smarty)
{
$smarty-> (this should autocomplete)
}
Or use the phpdoc hints:
/**
*
* @param $smarty Smarty
*/
function test (&$smarty)
{
$smarty-> (this should autocomplete too)
}
Another phpdoc hint will help for general type issues, but you have to use simple variables -> there are no hints for arrays at all (except $GLOBALS which accesses the simple global vars)
Or use the phpdoc hints:
/**
*
* @param Smarty $smarty
*/
function test (&$smarty)
{
$smarty-> (this should autocomplete too)
/* @var $db DB */
$db = &$_SESSION["db"];
}
The @var phpdoc declaration is the only one, which type is defined after the variable name]]>True2010-11-15T08:23:03-00:00Re: php content assist autocompletion help
https://www.eclipse.org/forums/index.php/mv/msg/199126/639289/#msg_639289
Ben K2010-11-15T22:35:02-00:00