-
-
Notifications
You must be signed in to change notification settings - Fork 137
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] Support {% set %} together with {# @var #} #1303
Comments
@Haehnchen Do you have an idea how to fix this? Can you maybe point me to where this "magic" happens, so that I can have a look at the code? If I can do it, I'd like to create a PR. But I might need some help setting building it. Thinking of it, it would be great if there was a step-by-step guide that teaches people how to build it 🙏 |
that looks like a missing merge, where first starting point for {{ web }} https://github.com/Haehnchen/idea-php-symfony2-plugin/blob/master/src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/TwigTemplateCompletionContributor.java#L219 provides now the "set" in anycase. the next "for(Map.Entry<String, PsiVariable> entry: TwigTypeResolveUtil.collectScopeVariables(parameters.getOriginalPosition()).entrySet()) {" is the doing the real Twig magic to find variables maybe more important {{ website.i }} |
but its maybe task for doing at this weekend, will see |
Thanks for your reply. Maybe you have a hint on how to solve this:
I'm inside IntelliJ IDEA and trying to run the |
looks like file permission issue. try checkout in same volume (suggest to use your /Users/... path). /Volumes/CS/ => /Users/Ruud/. |
Wow, it worked! I'm able to run the plugin now. This is so cool. I'm going to have a look and see if I can get it to work 💪 |
fixed via #1415, type name inside popover is still marked as "set", but type detection is working. popover is now just a priority what should be taken when there are more then 1 type. |
Tested it out, and it works when I specify it with However, it would be even smarter if I didn't have to to the |
This may not be related, but I'm a bit confused why the following doesn't work: {# @var ob \Type #}
{{ ob.thing.prop }} works really well!
{% set thing = ob.thing %}
{{ thing.prop }} no type info PHPStorm knows |
When I set a variable in Twig using
set
and define the type with@var
the plugin doesn't understand its type:Screenshot
You can see that the type of
website
isset
instead of\App\Website
:The text was updated successfully, but these errors were encountered: