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 馃槃
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
sry, ... but back in the game also improved performance a lot ;)
Seems nicely fixed with version 0.15.163. Thanks. 馃憤 It is one of the 馃攽 plugins to develop Symfony with PhpStorm 馃槃
@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.
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".

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".
I still can't find this setting :(
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".
I still can't find this setting :(
What version of PHPStorm are you using?
Here is another screenshot may help you

the latest version, just found it and wanted to delete the comment :)
offtopic - in symfony 4 app directory shouldn't be src ?
the latest version, just found it and wanted to delete the comment :)
offtopic - in symfony 4 app directory shouldn't be src ?
Yes, I think... In the last screenshot I was working in a 3.x project
I have the same issue. All plugins installed, phpStorm 2019, everything up to date.

assets directory is in public directory

but PHPStorm says that tere is _no suggestion_

Symfony 4.2
PHPStorm 2019.1
Symfony Plugin v0.17.172
PHP Annotations v5.3.3
PHP Toolbox v0.4.6
have you tried to rebuild the cache ?
@cybernet Yes, I totally removed var/cache also but didn't work
your problem is with phpstorm, not symfony, therefore, have you cleaned your PHPStorm cache ? under symfony tab you have clear index
@cybernet Yes I did but stil the same :/
Now, I also tried turn off and turn on the plugin, but without expected effects.
---edited---
I know where problem is but I do not know how to solve it.
Problem is in directory structure. My project root directory isn't directly symofony project. I have BackgroundProject for symfony and FrontProject for store pure html for my frontend developer.
-project root
|_ BackgroundProject
|_ FrontProject
In plugin settings I tried configure directory with ./ and without it but it still doesn't suggest.

When I opened new project using BackgroundProject directory as project root directory it everything works perfectly.
How to configure plugin to work in my directory structure? is it possible?
@nicraMarcin
I had exactly the same problem with the same directory structure. After a few tries I managed to do it with the following settings:
Symfony 3+:
Web Directory: projectdir/source/web
App Directory: projectdir/source/app
Symfony 4+:
Web Directory: projectdir/src
App Directory: projectdir/public
And... always clear the index :) Maybe you should also clear the PHPStorm cache.
It seems to be connected to the .idea settings, which were stored in my root folder "/".
@NickTick Yes, I cleared the index and tried set directories with leading ./ and without. but didn't help.
When I set project in _BackgroundProject_ directory as root it works.
@nicraMarcin
I had exactly the same problem with the same directory structure. After a few tries I managed to do it with the following settings:Symfony 3+:
Web Directory: projectdir/source/web
App Directory: projectdir/source/appSymfony 4+:
Web Directory: projectdir/src
App Directory: projectdir/publicAnd... always clear the index :) Maybe you should also clear the PHPStorm cache.
It seems to be connected to the .idea settings, which were stored in my root folder "/".
How to clear cache for PHPStorm?
@tom10271
How to clear cache for PHPStorm?
Yes, I did, but this didn't help as well.
I solved it by ohter way. I've starded using webpack bundle with symfony framework and this connects front and background well.
This will fix the problem.
Don't forget to clear index
As example for the folder templates

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.
Most helpful comment
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".