jitwatch-intellij
jitwatch-intellij copied to clipboard
Fix plugin to run on 2019.2 - 2019.3 with Kotlin 1.3
I have updated the plugin to work with both IntelliJ 2019.2 and 2019.3 EAP and Kotlin plugin versions 1.3.41 and 1.3.50
I have updated the plugin to work with IntelliJ 2018.1, 2018.2, 2018.3 and 2019.1
The plugin didn't build for me after checkout due to some path handling issue in gradle-intellij-plugin, so I've updated it. This also required a Gradle update.
It's possible to compile the plugin against each version by changing the platformVersion
property in gradle.properties
. I've adapted the approach the Rust plugin takes for that.
The Kotlin support seems to be "working" for the simple test case I threw at it. KotlinTypeMapper
takes different arguments now so I've taken a best guess as to what to pass for the parameters.
Fixes #7
It works more or less for 2019.2 thanks! "JITWatch Report" is empty.
@yburkouski I updated the plugin to work with 2019.2, the JITWatch report panel works with both Kotlin Plugin 1.3.50 and 1.3.41
Check out https://github.com/alshain/jitwatch-intellij/releases/tag/v1.0.2
@alshain no, nothing changed :) and it looks like '.jar' doesn't have some needed classes, so my install path is to build intellij->buildPlugin target and then installing '.zip' file that is about 4.7Mb.
Build log, I see some errors but BUILD SUCCESSFUL at the end. Using JDK 13, running test program under JDK 8
Task :compileKotlin UP-TO-DATE Task :compileJava NO-SOURCE Task :patchPluginXml UP-TO-DATE Task :processResources UP-TO-DATE Task :classes UP-TO-DATE Task :inspectClassesForKotlinIC UP-TO-DATE Task :instrumentCode UP-TO-DATE Task :postInstrumentCode Task :jar UP-TO-DATE Task :prepareSandbox UP-TO-DATE
Task :buildSearchableOptions WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.intellij.ide.ClassUtilCore to field sun.net.www.protocol.jar.JarFileFactory.fileCache WARNING: Please consider reporting this to the maintainers of com.intellij.ide.ClassUtilCore WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Starting searchable options index builder 2019-11-10 14:42:29,472 [ 3886] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting 2019-11-10 14:42:36,928 [ 11342] ERROR - j.openapi.roots.impl.RootIndex - Directory index may not be queried for default project java.lang.Throwable: Directory index may not be queried for default project at com.intellij.openapi.diagnostic.Logger.error(Logger.java:145) at com.intellij.openapi.roots.impl.RootIndex.
(RootIndex.java:59) at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getRootIndex(DirectoryIndexImpl.java:119) at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getOrderEntries(DirectoryIndexImpl.java:164) at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getOrderEntriesForFile(ProjectFileIndexImpl.java:108) at org.jetbrains.kotlin.idea.caches.project.GetModuleInfoKt.getModuleInfoByVirtualFile(getModuleInfo.kt:308) at org.jetbrains.kotlin.idea.core.script.dependencies.ScriptDependenciesResolveScopeProvider.getResolveScope(ScriptDependenciesResolveScopeProvider.kt:29) at com.intellij.psi.impl.file.impl.ResolveScopeManagerImpl.lambda$new$0(ResolveScopeManagerImpl.java:45) at com.intellij.util.containers.ConcurrentFactoryMap$3.create(ConcurrentFactoryMap.java:196) at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:46) at com.intellij.psi.impl.file.impl.ResolveScopeManagerImpl.getResolveScopeFromProviders(ResolveScopeManagerImpl.java:63) at com.intellij.psi.impl.file.impl.ResolveScopeManagerImpl.getResolveScope(ResolveScopeManagerImpl.java:119) at com.intellij.psi.impl.ResolveScopeManager.getElementResolveScope(ResolveScopeManager.java:51) at com.intellij.psi.impl.source.PsiFileImpl.getResolveScope(PsiFileImpl.java:858) at com.intellij.psi.impl.source.PsiCodeFragmentImpl.getResolveScope(PsiCodeFragmentImpl.java:307) at com.intellij.debugger.engine.evaluation.CodeFragmentFactoryContextWrapper.prepareResolveScope(CodeFragmentFactoryContextWrapper.java:69) at com.intellij.debugger.engine.evaluation.CodeFragmentFactoryContextWrapper.createPresentationCodeFragment(CodeFragmentFactoryContextWrapper.java:49) at org.jetbrains.java.debugger.JavaDebuggerEditorsProvider.createExpressionCodeFragment(JavaDebuggerEditorsProvider.java:77) at com.intellij.xdebugger.evaluation.XDebuggerEditorsProviderBase.createDocument(XDebuggerEditorsProviderBase.java:67) at com.intellij.xdebugger.evaluation.XDebuggerEditorsProviderBase.createDocument(XDebuggerEditorsProviderBase.java:59) at com.intellij.xdebugger.impl.ui.XDebuggerEditorBase.createDocument(XDebuggerEditorBase.java:347) at com.intellij.xdebugger.impl.ui.XDebuggerExpressionEditor. (XDebuggerExpressionEditor.java:48) at com.intellij.debugger.settings.CompoundRendererConfigurable. (CompoundRendererConfigurable.java:105) at com.intellij.debugger.settings.UserRenderersConfigurable. (UserRenderersConfigurable.java:31) 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 com.intellij.util.ReflectionUtil.newInstance(ReflectionUtil.java:389) at com.intellij.util.ReflectionUtil.newInstance(ReflectionUtil.java:376) at com.intellij.openapi.options.SimpleConfigurable.createUi(SimpleConfigurable.java:36) at com.intellij.openapi.options.ConfigurableBase.createComponent(ConfigurableBase.java:57) at com.intellij.ide.ui.search.SearchUtil.processConfigurables(SearchUtil.java:76) at com.intellij.ide.ui.search.SearchUtil.processProjectConfigurables(SearchUtil.java:48) at com.intellij.ide.ui.search.TraverseUIStarter.startup(TraverseUIStarter.java:106) at com.intellij.ide.ui.search.TraverseUIStarter.main(TraverseUIStarter.java:87) at com.intellij.idea.IdeaApplication.lambda$null$3(IdeaApplication.java:154) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192) at com.intellij.idea.IdeaApplication.lambda$executeInitAppInEdt$5(IdeaApplication.java:154) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:433) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) 2019-11-10 14:42:36,930 [ 11344] ERROR - j.openapi.roots.impl.RootIndex - IntelliJ IDEA 2019.2 Build #IC-192.5728.98 2019-11-10 14:42:36,930 [ 11344] ERROR - j.openapi.roots.impl.RootIndex - JDK: 11.0.3; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 2019-11-10 14:42:36,930 [ 11344] ERROR - j.openapi.roots.impl.RootIndex - OS: Windows 7 2019-11-10 14:42:36,977 [ 11391] ERROR - j.openapi.roots.impl.RootIndex - Plugin to blame: Kotlin version: 1.3.41-release-IJ2019.2-1 2019-11-10 14:42:36,978 [ 11392] ERROR - j.openapi.roots.impl.RootIndex - Last Action:
2019-11-10 14:42:36,978 [ 11392] ERROR - j.openapi.roots.impl.RootIndex - Assertion failed: Directory index can only be queried after project initialization java.lang.Throwable: Assertion failed: Directory index can only be queried after project initialization at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:180) at com.intellij.openapi.roots.impl.RootIndex.(RootIndex.java:63) at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getRootIndex(DirectoryIndexImpl.java:119) at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getOrderEntries(DirectoryIndexImpl.java:164) at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getOrderEntriesForFile(ProjectFileIndexImpl.java:108) at org.jetbrains.kotlin.idea.caches.project.GetModuleInfoKt.getModuleInfoByVirtualFile(getModuleInfo.kt:308) at org.jetbrains.kotlin.idea.core.script.dependencies.ScriptDependenciesResolveScopeProvider.getResolveScope(ScriptDependenciesResolveScopeProvider.kt:29) at com.intellij.psi.impl.file.impl.ResolveScopeManagerImpl.lambda$new$0(ResolveScopeManagerImpl.java:45) at com.intellij.util.containers.ConcurrentFactoryMap$3.create(ConcurrentFactoryMap.java:196) at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:46) at com.intellij.psi.impl.file.impl.ResolveScopeManagerImpl.getResolveScopeFromProviders(ResolveScopeManagerImpl.java:63) at com.intellij.psi.impl.file.impl.ResolveScopeManagerImpl.getResolveScope(ResolveScopeManagerImpl.java:119) at com.intellij.psi.impl.ResolveScopeManager.getElementResolveScope(ResolveScopeManager.java:51) at com.intellij.psi.impl.source.PsiFileImpl.getResolveScope(PsiFileImpl.java:858) at com.intellij.psi.impl.source.PsiCodeFragmentImpl.getResolveScope(PsiCodeFragmentImpl.java:307) at com.intellij.debugger.engine.evaluation.CodeFragmentFactoryContextWrapper.prepareResolveScope(CodeFragmentFactoryContextWrapper.java:69) at com.intellij.debugger.engine.evaluation.CodeFragmentFactoryContextWrapper.createPresentationCodeFragment(CodeFragmentFactoryContextWrapper.java:49) at org.jetbrains.java.debugger.JavaDebuggerEditorsProvider.createExpressionCodeFragment(JavaDebuggerEditorsProvider.java:77) at com.intellij.xdebugger.evaluation.XDebuggerEditorsProviderBase.createDocument(XDebuggerEditorsProviderBase.java:67) at com.intellij.xdebugger.evaluation.XDebuggerEditorsProviderBase.createDocument(XDebuggerEditorsProviderBase.java:59) at com.intellij.xdebugger.impl.ui.XDebuggerEditorBase.createDocument(XDebuggerEditorBase.java:347) at com.intellij.xdebugger.impl.ui.XDebuggerExpressionEditor. (XDebuggerExpressionEditor.java:48) at com.intellij.debugger.settings.CompoundRendererConfigurable. (CompoundRendererConfigurable.java:105) at com.intellij.debugger.settings.UserRenderersConfigurable. (UserRenderersConfigurable.java:31) 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 com.intellij.util.ReflectionUtil.newInstance(ReflectionUtil.java:389) at com.intellij.util.ReflectionUtil.newInstance(ReflectionUtil.java:376) at com.intellij.openapi.options.SimpleConfigurable.createUi(SimpleConfigurable.java:36) at com.intellij.openapi.options.ConfigurableBase.createComponent(ConfigurableBase.java:57) at com.intellij.ide.ui.search.SearchUtil.processConfigurables(SearchUtil.java:76) at com.intellij.ide.ui.search.SearchUtil.processProjectConfigurables(SearchUtil.java:48) at com.intellij.ide.ui.search.TraverseUIStarter.startup(TraverseUIStarter.java:106) at com.intellij.ide.ui.search.TraverseUIStarter.main(TraverseUIStarter.java:87) at com.intellij.idea.IdeaApplication.lambda$null$3(IdeaApplication.java:154) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192) at com.intellij.idea.IdeaApplication.lambda$executeInitAppInEdt$5(IdeaApplication.java:154) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:433) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) 2019-11-10 14:42:36,984 [ 11398] ERROR - j.openapi.roots.impl.RootIndex - IntelliJ IDEA 2019.2 Build #IC-192.5728.98 2019-11-10 14:42:36,984 [ 11398] ERROR - j.openapi.roots.impl.RootIndex - JDK: 11.0.3; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 2019-11-10 14:42:36,986 [ 11400] ERROR - j.openapi.roots.impl.RootIndex - OS: Windows 7 2019-11-10 14:42:36,986 [ 11400] ERROR - j.openapi.roots.impl.RootIndex - Plugin to blame: Kotlin version: 1.3.41-release-IJ2019.2-1 2019-11-10 14:42:36,986 [ 11400] ERROR - j.openapi.roots.impl.RootIndex - Last Action:
2019-11-10 14:42:37,348 [ 11762] ERROR - intellij.openapi.progress.Task - project.baseDir must not be null java.lang.IllegalStateException: project.baseDir must not be null at org.jetbrains.kotlin.idea.script.ScriptTemplatesFromDependenciesProvider.loadScriptDefinitions(scriptsTemplatesFromDependencies.kt:58) at org.jetbrains.kotlin.idea.script.AsyncScriptDefinitionsContributor$DefinitionsCollectorBackgroundTask.run(AsyncScriptDefinitionsContributor.kt:81) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:894) at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:447) 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.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:531) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:459) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:82) at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:302) at com.intellij.openapi.progress.Task.queue(Task.java:115) at org.jetbrains.kotlin.idea.script.AsyncScriptDefinitionsContributor.asyncRunUpdateScriptTemplates(AsyncScriptDefinitionsContributor.kt:47) at org.jetbrains.kotlin.idea.script.AsyncScriptDefinitionsContributor.getDefinitions(AsyncScriptDefinitionsContributor.kt:32) at org.jetbrains.kotlin.idea.core.script.ScriptDefinitionsManager.safeGetDefinitions(ScriptDefinitionsManager.kt:201) at org.jetbrains.kotlin.idea.core.script.ScriptDefinitionsManager.reloadScriptDefinitions(ScriptDefinitionsManager.kt:130) at org.jetbrains.kotlin.idea.core.script.ScriptDefinitionsManager.getAllDefinitions(ScriptDefinitionsManager.kt:145) at org.jetbrains.kotlin.idea.script.configuration.KotlinScriptingSettingsConfigurable.createComponent(KotlinScriptingSettingsConfigurable.java:42) at com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:155) at com.intellij.ide.ui.search.SearchUtil.processConfigurables(SearchUtil.java:76) at com.intellij.ide.ui.search.SearchUtil.processProjectConfigurables(SearchUtil.java:48) at com.intellij.ide.ui.search.TraverseUIStarter.startup(TraverseUIStarter.java:106) at com.intellij.ide.ui.search.TraverseUIStarter.main(TraverseUIStarter.java:87) at com.intellij.idea.IdeaApplication.lambda$null$3(IdeaApplication.java:154) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192) at com.intellij.idea.IdeaApplication.lambda$executeInitAppInEdt$5(IdeaApplication.java:154) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:433) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) 2019-11-10 14:42:37,351 [ 11765] ERROR - intellij.openapi.progress.Task - IntelliJ IDEA 2019.2 Build #IC-192.5728.98 2019-11-10 14:42:37,351 [ 11765] ERROR - intellij.openapi.progress.Task - JDK: 11.0.3; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 2019-11-10 14:42:37,351 [ 11765] ERROR - intellij.openapi.progress.Task - OS: Windows 7 2019-11-10 14:42:37,352 [ 11766] ERROR - intellij.openapi.progress.Task - Plugin to blame: Kotlin version: 1.3.41-release-IJ2019.2-1 2019-11-10 14:42:37,352 [ 11766] ERROR - intellij.openapi.progress.Task - Last Action:
Searchable options index builder completed
Task :jarSearchableOptions UP-TO-DATE Task :buildPlugin UP-TO-DATE
BUILD SUCCESSFUL in 18s 11 actionable tasks: 2 executed, 9 up-to-date 14:42:40: Task execution finished 'buildPlugin'.
@yburkouski can you share a stack trace from within the Intellij logs? Also, maybe try installing the build I published here: https://github.com/alshain/jitwatch-intellij/releases/tag/v1.0.2
I only tested from within gradlew :runIde
, but I'll test installing the plugin manually later.
@alshain do you have a build for 2020.2?