siropkin / kursor

Kursor is an IntelliJ plugin that enhances productivity by dynamically displaying the current keyboard language on your cursor and changing its color based on the language. Ideal for multilingual developers, it aims to minimize typing errors.
https://plugins.jetbrains.com/plugin/22072-kursor
8 stars 2 forks source link

Cannot init component state #21

Closed siropkin closed 2 days ago

siropkin commented 4 days ago

The error occurs when opening any project in a new idea window and does not occur again in that project. The error does not block the ability to use the plugin.

com.intellij.diagnostic.PluginException: Cannot init component state (componentName=package com.github.siropkin.kursor.settings.KursorSettings, componentClass=KursorSettings) [Plugin: com.github.siropkin.kursor]

               at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:185)

               at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:46)

               at com.intellij.serviceContainer.ComponentManagerImpl.initializeService$intellij_platform_serviceContainer(ComponentManagerImpl.kt:651)

               at com.intellij.serviceContainer.ServiceInstanceInitializer.createInstance$suspendImpl(ServiceInstanceInitializer.kt:70)

               at com.intellij.serviceContainer.ServiceInstanceInitializer.createInstance(ServiceInstanceInitializer.kt)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invokeSuspend(LazyInstanceHolder.kt:162)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)

               at kotlinx.coroutines..intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)

               at kotlinx.coroutines..BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)

               at kotlinx.coroutines..BuildersKt.withContext(Unknown Source)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invokeSuspend(LazyInstanceHolder.kt:160)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1.invoke(LazyInstanceHolder.kt)

               at kotlinx.coroutines..intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:27)

               at kotlinx.coroutines..CoroutineStart.invoke(CoroutineStart.kt:90)

               at kotlinx.coroutines..AbstractCoroutine.start(AbstractCoroutine.kt:123)

               at kotlinx.coroutines..BuildersKt__Builders_commonKt.launch(Builders.common.kt:52)

               at kotlinx.coroutines..BuildersKt.launch(Unknown Source)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.initialize(LazyInstanceHolder.kt:145)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.access$initialize(LazyInstanceHolder.kt:13)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.tryInitialize(LazyInstanceHolder.kt:135)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstance(LazyInstanceHolder.kt:95)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext$suspendImpl(LazyInstanceHolder.kt:87)

               at com.intellij.platform.instanceContainer.internal.LazyInstanceHolder.getInstanceInCallerContext(LazyInstanceHolder.kt)

               at com.intellij.serviceContainer.ComponentManagerImplKt$doGetOrCreateInstanceBlocking$1.invokeSuspend(ComponentManagerImpl.kt:1568)

               at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

               at kotlinx.coroutines..DispatchedTask.run(DispatchedTask.kt:104)

               at kotlinx.coroutines..EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)

               at kotlinx.coroutines..BlockingCoroutine.joinBlocking(Builders.kt:111)

               at kotlinx.coroutines..BuildersKt__BuildersKt.runBlocking$BuildersKt__BuildersKt(Builders.kt:84)

               at kotlinx.coroutines..BuildersKt__BuildersKt.runBlocking(Builders.kt:52)

               at kotlinx.coroutines..BuildersKt.runBlocking(Unknown Source)

               at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1686)

               at com.intellij.serviceContainer.ComponentManagerImplKt$runBlockingInitialization$1.invoke(ComponentManagerImpl.kt:1677)

               at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:85)

               at com.intellij.serviceContainer.ComponentManagerImplKt.runBlockingInitialization(ComponentManagerImpl.kt:1677)

               at com.intellij.serviceContainer.ComponentManagerImplKt.doGetOrCreateInstanceBlocking(ComponentManagerImpl.kt:1567)

               at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1562)

               at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:746)

               at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:690)

               at com.github.siropkin.kursor.settings.KursorSettings$Companion.getInstance(KursorSettings.kt:47)

               at com.github.siropkin.kursor.Kursor.getSettings(Kursor.kt:48)

               at com.github.siropkin.kursor.Kursor.paintComponent(Kursor.kt:116)

               at java.desktop/javax..swing.JComponent.paint(JComponent.java:1124)

               at java.desktop/javax..swing.JComponent.paintChildren(JComponent.java:964)

               at java.desktop/javax..swing.JComponent.paint(JComponent.java:1133)

               at com.intellij.openapi.editor.impl.EditorComponentImpl.paint(EditorComponentImpl.java:157)

               at java.desktop/javax..swing.JComponent.paintChildren(JComponent.java:964)

               at java.desktop/javax..swing.JComponent.paint(JComponent.java:1133)

               at java.desktop/javax..swing.JViewport.paint(JViewport.java:736)

               at com.intellij.ui.components.JBViewport.paint(JBViewport.java:240)

               at java.desktop/javax..swing.JComponent.paintChildren(JComponent.java:964)

               at com.intellij.ui.components.JBScrollPane.paintChildren(JBScrollPane.java:242)

               at java.desktop/javax..swing.JComponent.paint(JComponent.java:1133)

               at com.intellij.ui.components.JBScrollPane.paint(JBScrollPane.java:230)

               at java.desktop/javax..swing.JComponent.paintChildren(JComponent.java:964)

               at java.desktop/javax..swing.JComponent.paint(JComponent.java:1133)

               at java.desktop/javax..swing.JLayeredPane.paint(JLayeredPane.java:586)

               at java.desktop/javax..swing.JComponent.paintToOffscreen(JComponent.java:5319)

               at java.desktop/javax..swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1680)

               at java.desktop/javax..swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1655)

               at java.desktop/javax..swing.RepaintManager$PaintManager.paint(RepaintManager.java:1592)

               at java.desktop/javax..swing.RepaintManager.paint(RepaintManager.java:1352)

               at java.desktop/javax..swing.JComponent._paintImmediately(JComponent.java:5267)

               at java.desktop/javax..swing.JComponent.paintImmediately(JComponent.java:5077)

               at java.desktop/javax..swing.RepaintManager$4.run(RepaintManager.java:887)

               at java.desktop/javax..swing.RepaintManager$4.run(RepaintManager.java:870)

               at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)

               at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)

               at java.desktop/javax..swing.RepaintManager.paintDirtyRegions(RepaintManager.java:870)

               at java.desktop/javax..swing.RepaintManager.paintDirtyRegions(RepaintManager.java:843)

               at java.desktop/javax..swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:789)

               at java.desktop/javax..swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1921)

               at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)

               at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)

               at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)

               at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)

               at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)

               at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)

               at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)

               at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:696)

               at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$16(IdeEventQueue.kt:590)

               at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithoutImplicitRead(AnyThreadWriteThreadingSupport.kt:117)

               at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:590)

               at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)

               at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)

               at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)

               at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager..java:843)

               at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)

               at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)

               at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)

               at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)

               at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)

               at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)

               at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)

               at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)

               at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)

               at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)

               at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)

               at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)

               at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)

               at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)

               at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:389)

               at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)

               at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)

               at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)

               at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)

               at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)

               at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Caused by: com.intellij.util.xmlb.XmlSerializationException: Cannot deserialize class com.github.siropkin.kursor.settings.KursorSettings

               at com.intellij.configurationStore.StateStorageBaseKt.deserializeStateWithController(StateStorageBase.kt:375)

               at com.intellij.configurationStore.StateStorageBase.getState(StateStorageBase.kt:55)

               at com.intellij.configurationStore.ComponentStoreImpl$doCreateStateGetter$1.getState(ComponentStoreImpl.kt:650)

               at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:575)

               at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:493)

               at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:160)

               ... 109 more

Caused by: java.lang.IllegalArgumentException: No argument provided for a required parameter: parameter #0 arg0 of fun `<init>`(java.awt.color.ColorSpace!, kotlin.FloatArray!, kotlin.Float): java.awt.Color

               at kotlin.reflect.jvm..internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:195)

               at kotlin.reflect.jvm..internal.KCallableImpl.callBy(KCallableImpl.kt:112)

               at com.intellij.serialization.xml.KotlinAwareBeanBindingKt.createUsingKotlin(KotlinAwareBeanBinding.kt:133)

               at com.intellij.serialization.xml.KotlinAwareBeanBindingKt.access$createUsingKotlin(KotlinAwareBeanBinding.kt:1)

               at com.intellij.serialization.xml.KotlinAwareBeanBinding$resolveInstantiator$instantiator$1.invoke(KotlinAwareBeanBinding.kt:34)

               at com.intellij.serialization.xml.KotlinAwareBeanBinding.newInstance(KotlinAwareBeanBinding.kt:119)

               at com.intellij.util.xmlb.BeanBinding.deserialize(BeanBinding.kt:190)

               at com.intellij.util.xmlb.TagBinding.deserialize(TagBinding.kt:199)

               at com.intellij.util.xmlb.BeanBindingKt.deserializeNestedBindingInto(BeanBinding.kt:478)

               at com.intellij.configurationStore.StateStorageBaseKt.getXmlSerializedState(StateStorageBase.kt:452)

               at com.intellij.configurationStore.StateStorageBaseKt.deserializeStateWithController(StateStorageBase.kt:327)

               ... 114 more
siropkin commented 2 days ago

I found the reason: the cursor color setting was not saved correctly in the XML file with the plugin settings and, accordingly, could not be loaded later. I fixed the situation by adding a serializer/deserializer for saving and loading color from XML

siropkin commented 2 days ago

Fixed in v1.4.1