Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Twig] Go to function definition does not work when using the first-class callable syntax #2017

Closed
stof opened this issue Oct 11, 2022 · 1 comment
Labels

Comments

@stof
Copy link
Contributor

stof commented Oct 11, 2022

class TestExtension extends AbstractExtension
{
    public function getFunctions(): array
    {
        return [
            new TwigFunction('legacy_fn', [$this, 'testFn']),
            new TwigFunction('modern_fn', $this->testFn(...)),
        ];
    }

    public function testFn(): string
    {
        return 'test';
    }
}
{% set a = legacy_fn() %}
{% set b = modern_fn() %}

Clicking on legacy_fn in the Twig template brings me to the testFn method of the TestExtension defining the implementation of legacy_fn. But clicking on modern_fn does not do it.

Haehnchen added a commit that referenced this issue Oct 20, 2022
Haehnchen added a commit that referenced this issue Oct 20, 2022
Haehnchen added a commit that referenced this issue Oct 20, 2022
…-callable-public

#2017 fix [Twig] Go to function definition does not work when using the first-class callable syntax
@Haehnchen
Copy link
Owner

fixed, thx for reporting

Haehnchen added a commit that referenced this issue Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants