idea-php-toolbox
idea-php-toolbox copied to clipboard
[Twig] Allow completion for PHP defined method arguments inside Twig templates
.ide-toolbox.metadata.json:
{
"registrar": [
{
"provider": "bar_list",
"language": "php",
"signature": [
"App\\MyFoo::getBar"
]
}
],
"providers": [
{
"name": "bar_list",
"lookup_strings": ["bar1", "bar2", "bar3"]
}
]
}
namespace App;
class MyFoo
{
public function getBar($key = '')
{
return 'something';
}
}
Works in PHP:
/** @var \App\MyFoo $foo */
$foo->getBar('<CARET>');
But does not work in Twig templates:
{# @var foo \App\MyFoo #}
{{ foo.bar('<CARET>') }}
{{ foo.getBar('<CARET>') }}
(Setting "language": "twig" did not help either, but this should not be necessary. Should automatically work for both languages)
Good point, but Twig magic is inside the Symfony Plugin.