-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
PhpStorm 10: Unused symfony2 annotations imports #44
Comments
I did a clean installation, its working fine. @lsv that correct class is not imported so not known ;) |
Reinstall plugin and reindex didn't help |
Hell, I've even dropped |
@Haehnchen ofcourse, it was just to show that the @route actually looked for a class. In symfony fullstack there are two different classes that gives you the route annotation.
But if you use the component annotation then it works as before. But it is not just the route annotation, the Method annotation which only is in the frameworkextra does not work at all. (By "work" I mean it shows up as "class import never used", just in the first screenshot from OP) |
Yeah @lsv , Interesting note - component annotation marked as used correctly. At the same time FrameworkBundle one - not |
The only difference I can see on the two classes are The component route has the Target annotation, and the framework does not. But again, both worked perfect in PHPStorm 9 (and still does) but not in 10 (so what have changed I dont know) |
It seems like the following annotations are not detected when used: use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; The following work fine: use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Routing\Annotation\Route; This is quite an issue for me as it would mean I remove used use statements. |
+1 |
Any update on this? |
yes. targets are missing in all classes https://github.com/sensiolabs/SensioFrameworkExtraBundle/tree/master/Configuration. but that should not break, will check that changes between PhpStorm 9 > 10 psi-struct/lexer |
+1 |
can someone provide some project background. symfony version, ... ?. that ever i am trying all works as expected. :)
|
@Haehnchen currently I cannot reproduce this issue neither with PS10.0.3 nor with PS11 EAP (plugins are latest). Maybe something go fixed silently last two months. If some other confirm - then, issue should be gone. |
I think it has indeed been fixed in a patch in-between. I can verify tomorrow but I cannot remember running into this issue the past weeks. |
Update, I'm running 10.0.3 (jan 8) with annotations 2.6.2, and it's working here. |
@fracasula I think your issue is different. This plugin is to do with annotations, yours is a PhpStorm built in feature. You should raise this as an issue on YouTrack on Intellij's website. |
@hoshsadiq That's why I wrote "so I don't think it's this plugin the culprit" in my previous comment. I was trying to point out that maybe this whole thing could probably be just about PHPStorm and not the plugin at all. Just saying though, so if you guys are sure about this then it makes sense you keep posting here. |
For future reference, this has been fixed by installing the PHP Annotations plugin. |
so closed |
I still have this issue with PHP Annotation 3.0.1 and PHPStorm 2016.1.2 (145.1616). |
@Haehnchen |
not supporting version < 2016.x because of different api levels. versions + |
PhpStorm 2016.3.1 Same issue:
Both are |
Workaround is aliasing:
|
It's fixed again in the latest EAP of phpstorm |
Will this fix also be released for 2016.3.1? |
I have the same problem. PhpStorm 2016.3.1 PHP Annotations 4.2 Edit: |
I just upgraded to 2016.3.2 and now these annotations are broken. I've tried invalidating/restarting/re-indexing/reinstalling the PHP annotations plugins, etc. And nothing seems to work. :(
|
@lifo101 which version of PHP Annotations? |
v4.2.
…-- Jason
On Tue, Jan 3, 2017 at 9:28 AM, Igor Kugaudo ***@***.***> wrote:
@lifo101 <https://github.com/lifo101> which version of PHP Annotations?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWa6RurKDjK69LLTvKFuMmmFpk7nO8tks5rOlsqgaJpZM4GaT_i>
.
|
same here, running php annotations v4.2 with intellij 2016.3.2 |
I can confirm that Intellij 2016.3.2 with php annotations v4.2 it's having this problem |
Simple workaround (the aliasing suggestion someone made didn't work for me) is to simply reference the class of the unused imports. This way when you optimize imports protected function dummy()
{
// dummy code to fix bug in 'use' statements not being seen
// (IntelliJ v2016.3.2 + PHP Annotations v4.2)
Route::class;
Security::class;
} |
This is happening again :-( PHP Annotation Plugin 5.2.1 EDIT: |
Happens in 2018.1 |
in 2018.1 it happens because of old version plugin incompatibility. you should re-install (remove, restart, install, restart) plugins in order get them back to life |
Recently upgraded PHPStorm and had to do exactly as @scaytrase described above to get warnings about "use Doctrine\ORM\Mapping as ORM;" imports not being used even though I was using it within docblock annotations. I just uninstalled the PHP Annotations plugin, restarted PHPStorm, installed the PHP Annotations plugin, then restarted PHPStorm again. |
Annotation imports became mark unused right after aftercompletion succeedes.
PhpStorm 10.0
Build #PS-143.381, built on October 31, 2015
JRE: 1.8.0_51-b16 x86
JVM: Java HotSpot(TM) Server VM by Oracle Corporation
Plugin version: 2.6.1
The text was updated successfully, but these errors were encountered: