Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
913 stars 138 forks source link

Argument for @NotNull parameter 'path' of fr/adrienbrault/idea/symfony2plugin/templating/path/TwigPath #1105

Closed slowprog closed 2 years ago

slowprog commented 6 years ago

I updated PhpStorm and plugin has crashed.

PhpStorm 2017.3.1 Build #PS-173.3942.32, built on December 12, 2017 Licensed to imsxm.com

JRE: 1.8.0_152-release-1024-b8 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.13.2

Argument for @NotNull parameter 'path' of fr/adrienbrault/idea/symfony2plugin/templating/path/TwigPath.<init> must not be null
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'path' of fr/adrienbrault/idea/symfony2plugin/templating/path/TwigPath.<init> must not be null
    at fr.adrienbrault.idea.symfony2plugin.templating.path.TwigPath.$$$reportNull$$$0(TwigPath.java)
    at fr.adrienbrault.idea.symfony2plugin.templating.path.TwigPath.<init>(TwigPath.java)
    at fr.adrienbrault.idea.symfony2plugin.TwigHelper.getTwigNamespaces(TwigHelper.java:628)
    at fr.adrienbrault.idea.symfony2plugin.TwigHelper.getTwigNamespaces(TwigHelper.java:597)
    at fr.adrienbrault.idea.symfony2plugin.TwigHelper.getTemplatePsiElements(TwigHelper.java:259)
    at fr.adrienbrault.idea.symfony2plugin.templating.TemplateReference.multiResolve(TemplateReference.java:36)
    at com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference.resolves(PsiMultiReference.java:52)
    at com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference.lambda$static$0(PsiMultiReference.java:36)
    at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
    at java.util.TimSort.sort(TimSort.java:220)
    at java.util.Arrays.sort(Arrays.java:1438)
    at com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference.chooseReference(PsiMultiReference.java:72)
    at com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference.getCanonicalText(PsiMultiReference.java:135)
    at com.jetbrains.php.codeInsight.PhpTargetElementEvaluator.getElementByReference(PhpTargetElementEvaluator.java:33)
    at com.jetbrains.php.codeInsight.PhpTargetElementEvaluator.getElementByReference(PhpTargetElementEvaluator.java:24)
    at com.intellij.codeInsight.TargetElementUtil.b(TargetElementUtil.java:384)
    at com.intellij.codeInsight.TargetElementUtil.a(TargetElementUtil.java:366)
    at com.intellij.codeInsight.TargetElementUtil.a(TargetElementUtil.java:236)
    at com.intellij.codeInsight.TargetElementUtil.findTargetElement(TargetElementUtil.java:208)
    at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:92)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.d(PassExecutorService.java:437)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1127)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:430)
    at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:543)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:429)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:405)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:143)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:229)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:403)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:170)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
slowprog commented 6 years ago

I understood. I had two projects open and the plugin did not understand with which to work. My Bad.

TomasVotruba commented 5 years ago

@slowprog How did you fixed that? I have 2 Symfony projects in one monorepo (= 1 PHPStorm project) and I have the same crash.

TomasVotruba commented 5 years ago

Related Stackoverflow question: https://stackoverflow.com/questions/53668136/template-setting-page-for-symfony-twig-missing-after-phpstorm-ide-error

slowprog commented 5 years ago

@TomasVotruba I did not fix it. I just don’t use two projects at the same time :)

TomasVotruba commented 5 years ago

I though so :) Any clue where might be the problem? I really need to fix that, since the monorepo will have more and more Symfony projects.

slowprog commented 5 years ago

I do not know how to help you. If only to fork plugin and implements this.

TomasVotruba commented 5 years ago

I know PHP only.

For time being, I stick with manualy definitions in ide-twig.json. Even better, since it'se repository-lock, not program-IDE-lock. Like this:

https://github.com/TomasVotruba/open-project/blob/0ff005e400e7a02bc3da07312dce9a8184f5b637/ide-twig.json#L1-L9

slowprog commented 5 years ago

@Haehnchen Is it possible to implement support for multiple Symfony-projects for monorepos?

siguycmo commented 4 years ago

I have provided a solution on the Stackoverflow link above (https://stackoverflow.com/questions/53668136/template-setting-page-for-symfony-twig-missing-after-phpstorm-ide-error) for anyone else who may have this issue!

Haehnchen commented 2 years ago

duplicate: https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/1331