Atwix / phpstorm-plugin-feedback

6 stars 0 forks source link

[Bug] java.lang.Throwable: psiElement is not instance of requiredClass. #55

Closed pixelhed closed 7 months ago

pixelhed commented 7 months ago

Describe the bug (*)

Please, describe as much as possible about of what the bug is. It will help to solve this issue faster.

StackTrace from IDE

java.lang.Throwable: psiElement is not instance of requiredClass.
psiElement=PhpDocTagImpl: @package, psiElement.class=class com.jetbrains.php.lang.documentation.phpdoc.psi.impl.tags.PhpDocTagImpl, requiredClass=interface com.jetbrains.php.lang.psi.elements.PhpClass.
ref: 50cf572587cf
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: PSI and index do not match.
Please report the problem to JetBrains with the files attached
 file=PHP file, file.class=class com.jetbrains.php.lang.psi.PhpFileImpl, file.lang=Language: PHP, modStamp=130
 tree consistent
 stub debugInfo=created in calcStubTree; with backReference
 viewProvider=com.jetbrains.php.lang.PhpFileViewProvider{vFile=file:///XXX.php, vFileId=717785, content=VirtualFileContent{size=542}, eventSystemEnabled=true}
 viewProvider stamp: 1473288; file stamp: 1473288; file modCount: 1702306013083; file length: 542
 doc saved: true; doc stamp: 1473288; doc size: 540; committed: true
indexing info: indexing timestamp = 1702305977162, binary = false, byte size = 279, char size = 540
ref: 50cf572587cf
latestIndexedStub=StubTree{myDebugInfo='created from index; with backReference', myRoot=PhpFileStubImpl}1459909349
   same size=false
   debugInfo=created from index; with backReference
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.psi.stubs.StubProcessingHelperBase.inconsistencyDetected(StubProcessingHelperBase.java:151)
    at com.intellij.psi.stubs.StubProcessingHelperBase.checkType(StubProcessingHelperBase.java:85)
    at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:59)
    at com.intellij.psi.stubs.StubIndexEx.lambda$processElements$4(StubIndexEx.java:152)
    at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:201)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:102)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:90)
    at com.jetbrains.php.PhpIndexImpl.getElements(PhpIndexImpl.java:746)
    at com.jetbrains.php.PhpIndexImpl.getByName(PhpIndexImpl.java:1183)
    at com.jetbrains.php.PhpIndexImpl.getByFQN(PhpIndexImpl.java:1160)
    at com.jetbrains.php.PhpIndexImpl.getByFqnCacheAware(PhpIndexImpl.java:1241)
    at com.jetbrains.php.PhpIndexImpl.getClassesByFQNInternal(PhpIndexImpl.java:1236)
    at com.jetbrains.php.PhpIndexImpl.getAnyByFQN(PhpIndexImpl.java:1275)
    at com.atwix.magento.lang.php.util.PhpIndexProviderUtil.getAnyByFQN(PhpIndexProviderUtil.kt:58)
    at com.atwix.magento.lang.php.util.PhpIndexProviderUtil.getPhpTypeByFqn(PhpIndexProviderUtil.kt:29)
    at com.atwix.magento.lang.php.reference.provider.PhpClassReferenceProvider.getReferencesByElement(PhpClassReferenceProvider.kt:30)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:184)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:165)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:144)
    at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:51)
    at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:80)
    at com.intellij.psi.PsiReferenceServiceImpl.doGetReferences(PsiReferenceServiceImpl.java:35)
    at com.intellij.psi.PsiReferenceServiceImpl.getReferences(PsiReferenceServiceImpl.java:25)
    at com.intellij.codeInsight.highlighting.HyperlinkAnnotator.lambda$getReferences$0(HyperlinkAnnotator.java:75)
    at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
    at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:37)
    at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:240)
    at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:43)
    at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:240)
    at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111)
    at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27)
    at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:66)
    at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:241)
    at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:27)
    at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:69)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
    at com.intellij.codeInsight.highlighting.HyperlinkAnnotator.getReferences(HyperlinkAnnotator.java:74)
    at com.intellij.codeInsight.highlighting.HyperlinkAnnotator.annotateContributedReferences(HyperlinkAnnotator.java:58)
    at com.intellij.codeInsight.highlighting.HyperlinkAnnotator.annotate(HyperlinkAnnotator.java:53)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:128)
    at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:106)

To Reproduce (*)

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

If applicable, add screenshots to help explain your problem.

System information:

bohdan-harniuk commented 7 months ago

Hello @pixelhed,

Thank you for taking the time to report this issue. We greatly appreciate your contribution to improving our project.

Our team is now reviewing the problem, and we'll work on resolving it as quickly as possible. We will keep you updated on our progress, and if we have any questions or need more information from you, we'll reach out.

Once again, thank you for your report, and we'll do our best to address this issue promptly.

Best regards,

bohdan-harniuk commented 7 months ago

Hello @pixelhed,

Thank you for bringing this issue to our attention. Upon investigation, it appears that the reported problem is related to PHPStorm's native indexes.

We recommend performing a cache invalidation in PHPStorm as a preliminary step to resolve this issue. This process typically resolves transient issues like the one reported, which can occur sporadically due to various factors, such as unexpected shutdowns or other external influences.

As this concern seems to be associated with PHPStorm's native behaviour and does not directly pertain to our plugin, we're marking this matter as closed. However, if after attempting cache invalidation, the issue persists or if you require further assistance related to our plugin, please feel free to reopen this issue, and we'll be glad to assist you further.

Thank you for your understanding and cooperation.

Best regards,