carymrobbins/intellij-haskforce

Plugin is incompatible with IntelliJ IDEA 2019.2

Closed this issue · 8 comments

When I install a plugin to IntelliJ IDEA 2019.2 I get an exception (see below). This happens because the plugin uses classes from Java support but doesn't declare dependency on Java plugin. It worked in previous versions of IntelliJ IDEA because the plugin sets a deprecated option use-idea-classloader in its plugin.xml, and Java support was loaded by the same classloader as part of the platform. But since 2019.2 Java support is extracted to a separate plugin so you need to explicitly declare dependency on Java, see this blog post for details.

com.intellij.openapi.extensions.impl.PicoPluginExtensionInitializationException: java.lang.ClassNotFoundException: com.intellij.compiler.server.CompileServerPlugin
	at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.createInstance(ExtensionComponentAdapter.java:50)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.java:54)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:439)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:410)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensionList(ExtensionPointImpl.java:226)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.addExtensionPointListener(ExtensionPointImpl.java:704)
	at com.intellij.jps.impl.JpsIdePluginManagerImpl.<init>(JpsIdePluginManagerImpl.java:38)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:779)
	at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:721)
	at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1394)
	at org.jetbrains.jps.service.impl.JpsServiceManagerImpl.loadExtensions(JpsServiceManagerImpl.java:91)
	at org.jetbrains.jps.service.impl.JpsServiceManagerImpl.getExtensions(JpsServiceManagerImpl.java:73)
	at org.jetbrains.jps.model.serialization.JpsModelSerializerExtension.getExtensions(JpsModelSerializerExtension.java:46)
	at org.jetbrains.jps.model.serialization.module.JpsModuleRootModelSerializer.getSourceRootPropertiesSerializer(JpsModuleRootModelSerializer.java:187)
	at org.jetbrains.jps.model.serialization.module.JpsModuleRootModelSerializer.loadSourceRoot(JpsModuleRootModelSerializer.java:170)
	at com.intellij.openapi.roots.impl.SourceFolderImpl.<init>(SourceFolderImpl.java:45)
	at com.intellij.openapi.roots.impl.ContentEntryImpl.loadSourceFolders(ContentEntryImpl.java:79)
	at com.intellij.openapi.roots.impl.ContentEntryImpl.<init>(ContentEntryImpl.java:58)
	at com.intellij.openapi.roots.impl.RootModelImpl.<init>(RootModelImpl.java:100)
	at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.lambda$loadState$1(ModuleRootManagerImpl.java:345)
	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
	at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.loadState(ModuleRootManagerImpl.java:359)
	at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.loadState(ModuleRootManagerImpl.java:339)
	at com.intellij.openapi.roots.impl.ModuleRootManagerComponent.loadState(ModuleRootManagerComponent.java:22)
	at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:405)
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:355)
	at com.intellij.configurationStore.ComponentStoreImpl.initPersistenceStateComponent(ComponentStoreImpl.kt:122)
	at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:97)
	at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.initializeComponent(PlatformComponentManagerImpl.java:44)
	at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:501)
	at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:126)
	at com.intellij.openapi.module.impl.ModuleImpl.init(ModuleImpl.java:81)
	at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.initModule(ModuleManagerImpl.java:840)
	at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.lambda$loadModuleInternal$2(ModuleManagerImpl.java:833)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:936)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.loadModuleInternal(ModuleManagerImpl.java:831)
	at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.access$400(ModuleManagerImpl.java:665)
	at com.intellij.openapi.module.impl.ModuleManagerImpl.lambda$null$0(ModuleManagerImpl.java:302)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$3(CoreProgressManager.java:185)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:185)
	at com.intellij.openapi.module.impl.ModuleManagerImpl.lambda$loadModules$1(ModuleManagerImpl.java:300)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:207)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$100(BoundedTaskExecutor.java:29)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.lambda$run$0(BoundedTaskExecutor.java:185)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:208)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:181)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.intellij.compiler.server.CompileServerPlugin
	at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getImplementationClass(ExtensionComponentAdapter.java:94)
	at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.createInstance(ExtensionComponentAdapter.java:38)
	... 62 more
Caused by: java.lang.ClassNotFoundException: com.intellij.compiler.server.CompileServerPlugin
	at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:282)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getImplementationClass(ExtensionComponentAdapter.java:91)
	... 63 more
orome commented

Ditto. Hangs 2019.2 can proceed to use the IDE.

I have the same problem. ;(

I get the exception when I open a Haskell project in IDEA. The project was previously working fine with HaskForce.

If I ignore the IDE Error warning, I get multiple related errors during indexing.

Error while indexing /my/path/to/HaskellModule.hs
To reindex this file IDEA has to be restarted

com.intellij.diagnostic.PluginException: Different word scanner instances should be used for different threads, make sure that com.intellij.lang.cacheBuilder.DefaultWordsScanner@391f868a with FlexAdapter for com.haskforce.highlighting._HaskellSyntaxHighlightingLexer is instantiated on every request and not shared [Plugin: com.haskforce]
at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:403)
at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:69)
at com.intellij.lang.cacheBuilder.DefaultWordsScanner.processWords(DefaultWordsScanner.java:95)
at com.intellij.psi.impl.cache.impl.id.ScanningIdIndexer.map(ScanningIdIndexer.java:29)
at com.intellij.psi.impl.cache.impl.id.ScanningIdIndexer.map(ScanningIdIndexer.java:19)
at com.intellij.psi.impl.cache.impl.id.IdIndex$3.map(IdIndex.java:83)
at com.intellij.psi.impl.cache.impl.id.IdIndex$3.map(IdIndex.java:77)
at com.intellij.util.indexing.impl.MapReduceIndex.mapInput(MapReduceIndex.java:313)
at com.intellij.util.indexing.VfsAwareMapReduceIndex.mapInput(VfsAwareMapReduceIndex.java:108)
at com.intellij.util.indexing.impl.MapReduceIndex.calculateUpdateData(MapReduceIndex.java:269)
at com.intellij.util.indexing.impl.MapReduceIndex.update(MapReduceIndex.java:251)
at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1673)
at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$28(FileBasedIndexImpl.java:1603)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyIn(FileTypeManagerImpl.java:634)
at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1562)
at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1549)
at com.intellij.util.indexing.UnindexedFilesUpdater.lambda$indexFiles$0(UnindexedFilesUpdater.java:109)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$0(CacheUpdateRunner.java:219)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$1(CacheUpdateRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.run(CacheUpdateRunner.java:232)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

orome commented

Any news on this? This completely beaks IJ for Haskell.

Looking into it. I have a branch 396-idea-2019.2 which starts towards resolving this but I'm having some trouble resolving the dependency on IntelliJ now.

% ./gradlew assemble

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'intellij-haskforce'.
> Could not resolve all dependencies for configuration ':detachedConfiguration1'.
   > Could not resolve com.jetbrains.intellij.idea:ideaIC:2019.2.
     Required by:
         project :
      > Could not resolve com.jetbrains.intellij.idea:ideaIC:2019.2.
         > Could not get resource 'https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/2019.2/ideaIC-2019.2.pom'.
            > Could not GET 'https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/2019.2/ideaIC-2019.2.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.171 secs

Will be digging in further. If anyone has ideas in the meantime, feel free to suggest or even cut a PR.

Update: That previous issue was just a problem with the cacerts included with OpenJDK 8, resolved by replacing it with the cacerts included with Oracle JDK 11.

I'm having trouble with the new :buildSearchableOptions task in the gradle-intellij-plugin, see issue JetBrains/intellij-platform-gradle-plugin#424. I may just try disabling/skipping that task in the meantime.

Here's a pre-release build that should work - v0.3.43-SNAPSHOT-01bf613d

I will look to cut a release with these changes sometime next week.

Thanks!! I very much appreciate your work!