idea-php-toolbox icon indicating copy to clipboard operation
idea-php-toolbox copied to clipboard

[Twig] Allow completion for PHP defined method arguments inside Twig templates

Open King2500 opened this issue 8 years ago • 1 comments

.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)

King2500 avatar Mar 26 '17 18:03 King2500

Good point, but Twig magic is inside the Symfony Plugin.

Haehnchen avatar Mar 27 '17 18:03 Haehnchen