dryabov / phpregexp

Support of regular expressions parsing in PhpStorm
MIT License
4 stars 2 forks source link

Fatal Error in the PHPStorm #12

Closed lujewwy closed 3 years ago

lujewwy commented 3 years ago

Hello! Recently I've started to receive a notification from my PHPStorm 2020.3.3 IDE regarding the exception in the plugin 'PHP RegExp Support (0.9.6)'. Here's the stacktrace from there:

Error during processing of: Type.php

java.lang.RuntimeException: After patch: doc:
'^\\?([sS][tT][aA][tT][iI][cC]|\$this)$'
---PSI:
'^\\?([sS][tT][aA][tT][iI][cC]|this)$'
---chars:
'^\\?([sS][tT][aA][tT][iI][cC]|this)$'.
OK let's see. Host file: PHP file in '<path-to-my-project>\dev-tools\phan\vendor\phan\phan\src\Phan\Language\Type.php' (Language: PHP) 
Was injected Language: PhpRegExpXT at ranges: [Shred prefix='^\\?([sS][tT][aA][tT][iI][cC]|' in StringLiteralExpressionImpl: '/^\\\\\\\\?([sS][tT][aA]... with range (77286,77332) (class com.jetbrains.php.lang.psi.elements.impl.StringLiteralExpressionImpl) inside range (35,43)]
    at com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.parseFile(InjectionRegistrarImpl.java:699)
    at com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.createAndRegisterInjected(InjectionRegistrarImpl.java:255)
    at com.intellij.psi.impl.source.tree.injected.InjectionRegistrarImpl.doneInjecting(InjectionRegistrarImpl.java:220)
    at com.dryabov.phpStorm.phpregexp.PhpRegexpLanguageInjector.getLanguagesToInject(PhpRegexpLanguageInjector.java:339)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:418)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUp(InjectedLanguageUtilBase.java:207)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:137)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:107)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.enumerate(InjectedLanguageManagerImpl.java:310)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.getInjectedPsiFiles(InjectedLanguageManagerImpl.java:432)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processInjectedFile(LowLevelSearchUtil.java:47)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processTreeUp(LowLevelSearchUtil.java:83)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.lambda$processElementsAtOffsets$0(LowLevelSearchUtil.java:179)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processOffsets(LowLevelSearchUtil.java:205)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processElementsAtOffsets(LowLevelSearchUtil.java:178)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.execute(PsiSearchHelperImpl.java:944)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$2.processInReadAction(PsiSearchHelperImpl.java:280)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$2.processInReadAction(PsiSearchHelperImpl.java:271)
    at com.intellij.openapi.application.ReadActionProcessor.lambda$process$0(ReadActionProcessor.java:25)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:885)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
    at com.intellij.openapi.application.ReadActionProcessor.process(ReadActionProcessor.java:25)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processCandidates$18(PsiSearchHelperImpl.java:905)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processVirtualFile$11(PsiSearchHelperImpl.java:543)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1137)
    at com.intellij.openapi.application.ex.ApplicationUtil.tryRunReadAction(ApplicationUtil.java:33)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processVirtualFile(PsiSearchHelperImpl.java:525)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processPsiFileRoots$7(PsiSearchHelperImpl.java:400)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processFilesConcurrentlyDespiteWriteActions$8(PsiSearchHelperImpl.java:473)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:172)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processFilesConcurrentlyDespiteWriteActions$9(PsiSearchHelperImpl.java:472)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
    at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:86)
    at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
dryabov commented 3 years ago
  1. Which PHPStorm version do you use?
  2. What is the mentioned Type.php file? Is it a file from an opensource framework, or just a your private file (i.e. is it possible to see its source)?
lujewwy commented 3 years ago
  1. PHPStorm 2020.3.3 (Build #PS-203.7717.64, built on March 16, 2021)
  2. This file is from an opensource framework that can be found here: https://github.com/phan/phan.git and the path to the file there is src/Phan/Language/Type.php
dryabov commented 3 years ago

I've just released v.0.9.7, the issue should be fixed there.

lujewwy commented 3 years ago

Thank you for the quick reaction! For now it seems like it works without any errors.