dryabov / phpregexp

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

Error with PHPStorm 2019.2 EAP #9

Closed EagleEyeJohn closed 5 years ago

EagleEyeJohn commented 5 years ago
java.lang.ExceptionInInitializerError
    at com.dryabov.phpStorm.phpregexp.PhpRegexpParserDefinition.<clinit>(PhpRegexpParserDefinition.java:15)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Unknown Source)
    at com.intellij.openapi.extensions.AbstractExtensionPointBean.findClass(AbstractExtensionPointBean.java:41)
    at com.intellij.util.ExtensionInstantiator.instantiateWithPicoContainerOnlyIfNeeded(ExtensionInstantiator.java:34)
    at com.intellij.openapi.extensions.CustomLoadingExtensionPointBean.instantiateExtension(CustomLoadingExtensionPointBean.java:21)
    at com.intellij.lang.LanguageExtensionPoint.lambda$new$0(LanguageExtensionPoint.java:31)
    at com.intellij.openapi.util.NotNullLazyValue$2.compute(NotNullLazyValue.java:67)
    at com.intellij.openapi.util.NotNullLazyValue.getValue(NotNullLazyValue.java:38)
    at com.intellij.lang.LanguageExtensionPoint.getInstance(LanguageExtensionPoint.java:36)
    at com.intellij.openapi.util.KeyedExtensionCollector.buildExtensionsFromExtensionPoint(KeyedExtensionCollector.java:184)
    at com.intellij.openapi.util.KeyedExtensionCollector.buildExtensions(KeyedExtensionCollector.java:161)
    at com.intellij.lang.LanguageExtension.buildExtensions(LanguageExtension.java:99)
    at com.intellij.lang.LanguageExtension.buildExtensions(LanguageExtension.java:24)
    at com.intellij.openapi.util.KeyedExtensionCollector.forKey(KeyedExtensionCollector.java:139)
    at com.intellij.lang.LanguageExtension.findForLanguage(LanguageExtension.java:61)
    at com.intellij.lang.LanguageExtension.forLanguage(LanguageExtension.java:53)
    at com.intellij.lang.LanguageUtil.isInjectableLanguage(LanguageUtil.java:101)
    at org.intellij.plugins.intelliLang.inject.InjectedLanguage.initLanguageCache(InjectedLanguage.java:114)
    at org.intellij.plugins.intelliLang.inject.InjectedLanguage.findLanguageById(InjectedLanguage.java:79)
    at org.intellij.plugins.intelliLang.InjectionsSettingsUI$CfgInfo.lambda$null$0(InjectionsSettingsUI.java:773)
    at com.intellij.util.containers.ContainerUtil.findAll(ContainerUtil.java:1134)
    at org.intellij.plugins.intelliLang.InjectionsSettingsUI$CfgInfo.lambda$new$1(InjectionsSettingsUI.java:771)
    at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1624)
    at org.intellij.plugins.intelliLang.InjectionsSettingsUI$CfgInfo.<init>(InjectionsSettingsUI.java:766)
    at org.intellij.plugins.intelliLang.InjectionsSettingsUI.<init>(InjectionsSettingsUI.java:83)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:88)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.instantiateGuarded(CachingConstructorInjectionComponentAdapter.java:66)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:48)
    at com.intellij.openapi.extensions.AbstractExtensionPointBean.instantiate(AbstractExtensionPointBean.java:73)
    at com.intellij.openapi.extensions.AbstractExtensionPointBean.instantiate(AbstractExtensionPointBean.java:67)
    at com.intellij.openapi.options.ConfigurableEP$ClassProducer.createElement(ConfigurableEP.java:357)
    at com.intellij.openapi.options.ConfigurableEP.createConfigurable(ConfigurableEP.java:266)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.createConfigurable(ConfigurableWrapper.java:43)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.getConfigurable(ConfigurableWrapper.java:108)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.cast(ConfigurableWrapper.java:83)
    at com.intellij.openapi.options.ex.ConfigurableWrapper$CompositeWrapper.getConfigurables(ConfigurableWrapper.java:256)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.collect(ShowSettingsUtilImpl.java:76)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.collect(ShowSettingsUtilImpl.java:76)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.getConfigurables(ShowSettingsUtilImpl.java:67)
    at com.intellij.ide.util.gotoByName.GotoActionModel.lambda$new$0(GotoActionModel.java:77)
    at com.intellij.openapi.util.VolatileNotNullLazyValue$1.compute(VolatileNotNullLazyValue.java:56)
    at com.intellij.openapi.util.VolatileNotNullLazyValue.getValue(VolatileNotNullLazyValue.java:36)
    at com.intellij.ide.util.gotoByName.GotoActionModel.getConfigurablesNames(GotoActionModel.java:329)
    at com.intellij.ide.util.gotoByName.GotoActionItemProvider.processOptions(GotoActionItemProvider.java:127)
    at com.intellij.ide.util.gotoByName.GotoActionItemProvider.filterElements(GotoActionItemProvider.java:78)
    at com.intellij.ide.actions.searcheverywhere.ActionSearchEverywhereContributor.fetchElements(ActionSearchEverywhereContributor.java:90)
    at com.intellij.ide.actions.searcheverywhere.MultiThreadSearcher$ContributorSearchTask.lambda$run$1(MultiThreadSearcher.java:176)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
    at com.intellij.ide.actions.searcheverywhere.MultiThreadSearcher$ContributorSearchTask.run(MultiThreadSearcher.java:176)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:208)
    at com.intellij.util.ConcurrencyUtil.lambda$underThreadNameRunnable$3(ConcurrencyUtil.java:196)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:321)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.intellij.diagnostic.ImplementationConflictException: Language with ID 'PhpRegExp' is already registered: class com.jetbrains.php.codeInsight.regexp.PhpRegexpLanguage
    at com.intellij.lang.Language.<init>(Language.java:81)
    at com.dryabov.phpStorm.phpregexp.PhpRegexpLanguage.<init>(PhpRegexpLanguage.java:10)
    at com.dryabov.phpStorm.phpregexp.PhpRegexpLanguage.<clinit>(PhpRegexpLanguage.java:7)
    ... 67 more
dryabov commented 5 years ago

It looks like they are trying to support PHP regexp in 2019.2 out of the box, so maybe further this plugin will not be necessary.

Details of the issue: language id "PhpRegExp" is registered by PhpStorm and the plugin fails to initialize.

Currently built-in PHP regexp doesn't process some side cases properly (e.g. it warns about "redundant character escape" in regexp like '#;\#;#'), so I'll try to change language id and rebuild the plugin soon (another advantage of my plugin is optional possibility to auto-detect regexp in other strings not limited to direct arguments of preg_... functions).

dryabov commented 5 years ago

Fixed in https://github.com/dryabov/phpregexp/releases/tag/0.9.4 (will be uploaded to plugins.jetbrains.com a little bit later).