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 component : no CTRL-click navigation to template for components with a name_prefix #2382

Open
yched opened this issue May 28, 2024 · 0 comments

Comments

@yched
Copy link

yched commented May 28, 2024

CTRL-click on <twig:MyComponent> in a template, is supposed to let the user choose between navigating to the component PHP class or to the component template :
image

It seems this doesn't fully work for components with a named_prefix :
CTRL-click brings directly to the PHP class, and doesn't offer to go to the template

Example :

twig_component:
    anonymous_template_directory: 'components/'
    defaults:
        App\Twig\Components\: 'components/'
        App\Twig\PrefixedComponents\: 
            template_directory: 'components/'
            name_prefix: Prefix
  • MyComponent defined in
    src/Twig/Components/MyComponent.php
    templates/components/MyComponent.html.twig
  • MyComponent2 defined in
    src/Twig/PrefixedComponents/MyComponent2.php
    templates/components/MyComponent2.html.twig

Then in a twig file using both components :

    <twig:MyComponent>Hello</twig:MyComponent>
    <twig:Prefix:MyComponent2>Hello</twig:Prefix:MyComponent2>

CTRL-click on the 1st shows the popup to chose between MyComponent.php or MyComponent.html.twig
CTRL-click on the 2nd directly opens MyComponent2.php, I can't navigate to MyComponent2.html.twig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant