idea-php-symfony2-plugin: asset() autocompletion fails in PHPStorm 2017.3

I am using Symfony 3.4.1. In twig templates, it is not suggesting resources in public directory anymore whilst using {{ asset('abc.jpg') }}. It says Missing asset... yet it renders correctly when we display it on browsers.

This is my framework.yaml:

framework:
    secret: '%env(APP_SECRET)%'
    default_locale: tr
    translator:
      fallbacks: ['tr']
    #csrf_protection: ~
    #http_method_override: true

    # uncomment this entire section to enable sessions
    session:
        # With this config, PHP's native session handling is used
        handler_id: ~

    #esi: ~
    #fragments: ~
    php_errors:
        log: true

    templating:
        engines: twig
        form:
            resources:
                - 'App:Form'

This is my PHPStorm version:

PhpStorm 2017.3
Build #PS-173.3727.138, built on November 28, 2017
JRE: 1.8.0_152-release-1024-b6 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13.2

Any idea how to gain autocompletion back? Because we love it 💯 percent 😄

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 20 (5 by maintainers)

Commits related to this issue

Most upvoted comments

If you are using Symfony 4.x the default directory for assets is ‘public’ instead of ‘web’, so the plugin can’t find the assets.

The solution is simply change the Web Directory config in the plugin’s settings to “public”.

sf

If you are using Symfony 4.x the default directory for assets is ‘public’ instead of ‘web’, so the plugin can’t find the assets. The solutions is simpy change the Web Directory config in the plugin’s settings to “public”. sf

I still can’t find this setting 😦

What version of PHPStorm are you using?

Here is another screenshot may help you

settings

As an extra note, neither clearing project’s cache nor Symfony plugin’s cache helps 😦

PhpStorm 2017.3.1
Build #PS-173.3942.32, built on December 12, 2017
JRE: 1.8.0_152-release-1024-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 8.1 6.3

Symfony plugin 0.15.162

After everything above, this is what solve the problem for me: Ctrl + Alt + S > Languages & Frameworks > PHP > Annotations > Actions > SCHEDULE ANNOTATION REINDEX

Clicked that button, software indexed the project, and I got my sanity and autocomplete back.

@Haehnchen

This same (mis)behavior – report of Missing asset... but correct render – is again occurring with

PhpStorm 2018.1 EAP
Build #PS-181.4203.107, built on March 14, 2018
PhpStorm EAP User
Expiration date: April 13, 2018
JRE: 1.8.0_152-release-1136-b20 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.10-4-default

and

Symfony Plugin (0.16.165)
PHP Annotations (5.3)
PHP Toolbox (0.4.6)

Plugins uninstall/reinstall seems to make no difference.

Assuming I’ve not missed something, not sure if you want to reopen here, or open as a new bug.

Seems nicely fixed with version 0.15.163. Thanks. 👍 It is one of the 🔑 plugins to develop Symfony with PhpStorm 😄

sry, … but back in the game also improved performance a lot 😉