DragonKnightOfBreeze / Paradox-Language-Support

IDEA Plugin: Paradox Language Support.
https://windea.icu/Paradox-Language-Support
MIT License
36 stars 4 forks source link

Plugin is breaking and throwing exceptions #53

Open antick opened 9 months ago

antick commented 9 months ago

This is what I am getting:

java.lang.AssertionError
    at com.intellij.util.xmlb.MapBinding.deserializeKeyOrValue(MapBinding.java:325)
    at com.intellij.util.xmlb.MapBinding.deserialize(MapBinding.java:241)
    at com.intellij.util.xmlb.MapBinding.deserializeList(MapBinding.java:168)
    at com.intellij.util.xmlb.Binding.deserializeList(Binding.java:25)
    at com.intellij.util.xmlb.AccessorBindingWrapper.deserializeList(AccessorBindingWrapper.java:141)
    at com.intellij.util.xmlb.BeanBinding.deserializeInto(BeanBinding.java:259)
    at com.intellij.util.xmlb.BeanBinding.deserializeInto(BeanBinding.java:199)
    at com.intellij.util.xmlb.BeanBinding.deserialize(BeanBinding.java:142)
    at com.intellij.configurationStore.JdomSerializerImpl.deserialize(xmlSerializer.kt:93)
    at com.intellij.configurationStore.DefaultStateSerializerKt.deserializeState(DefaultStateSerializer.kt:29)
    at com.intellij.configurationStore.StateStorageBase.deserializeState(StateStorageBase.kt:32)
    at com.intellij.configurationStore.StateGetterImpl.getState(StorageBaseEx.kt:56)
    at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:470)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:415)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:121)
    at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:48)
    at com.intellij.serviceContainer.ComponentManagerImpl.initializeComponent$intellij_platform_serviceContainer(ComponentManagerImpl.kt:577)
    at com.intellij.serviceContainer.ComponentManagerImpl.createLightService(ComponentManagerImpl.kt:939)
    at com.intellij.serviceContainer.ComponentManagerImpl.getOrCreateLightService$lambda$10$lambda$8(ComponentManagerImpl.kt:740)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:64)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221)
    at com.intellij.serviceContainer.ComponentManagerImpl.getOrCreateLightService(ComponentManagerImpl.kt:739)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:688)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:630)
    at icu.windea.pls.core.PluginExtensionsKt.getProfilesSettings(PluginExtensions.kt:393)
    at icu.windea.pls.model.ParadoxModRootInfo.getGameType(ParadoxRootInfo.kt:80)
    at icu.windea.pls.lang.ParadoxDefinitionHandler.doGetInfo(ParadoxDefinitionHandler.kt:72)
    at icu.windea.pls.lang.ParadoxDefinitionHandler.doGetInfoFromCache$lambda$1(ParadoxDefinitionHandler.kt:51)
    at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
    at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:37)
    at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:240)
    at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:43)
    at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:240)
    at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110)
    at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27)
    at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65)
    at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:241)
    at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:27)
    at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:69)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
    at icu.windea.pls.lang.ParadoxDefinitionHandler.doGetInfoFromCache(ParadoxDefinitionHandler.kt:48)
    at icu.windea.pls.lang.ParadoxDefinitionHandler.getInfo(ParadoxDefinitionHandler.kt:44)
    at icu.windea.pls.core.PluginExtensionsKt.getDefinitionInfo(PluginExtensions.kt:214)
    at icu.windea.pls.script.psi.impl.ParadoxScriptPsiImplUtil.getIcon(ParadoxScriptPsiImplUtil.kt:149)
    at icu.windea.pls.script.psi.impl.ParadoxScriptPropertyImpl.getIcon(ParadoxScriptPropertyImpl.java:56)
    at icu.windea.pls.core.PlatformExtensionsKt.getIcon(PlatformExtensions.kt:823)
    at icu.windea.pls.cwt.navigation.CwtNavBar.getIcon(CwtNavBar.kt:16)
    at com.intellij.ide.navbar.impl.DefaultNavBarItem$presentation$icon$1.invoke(DefaultNavBarItem.kt:53)
    at com.intellij.ide.navbar.impl.DefaultNavBarItem$presentation$icon$1.invoke(DefaultNavBarItem.kt:53)
    at com.intellij.ide.navbar.impl.DefaultNavBarItemProviderKt.fromOldExtensions(DefaultNavBarItemProvider.kt:156)
    at com.intellij.ide.navbar.impl.DefaultNavBarItem.presentation(DefaultNavBarItem.kt:53)
    at com.intellij.ide.navbar.ide.NavBarVmItemKt.toVmItems(NavBarVmItem.kt:50)
    at com.intellij.ide.navbar.ide.NavBarServiceKt.contextModelInner(NavBarService.kt:159)
    at com.intellij.ide.navbar.ide.NavBarServiceKt.access$contextModelInner(NavBarService.kt:1)
    at com.intellij.ide.navbar.ide.NavBarServiceKt$contextModel$2.invoke(NavBarService.kt:137)
    at com.intellij.ide.navbar.ide.NavBarServiceKt$contextModel$2.invoke(NavBarService.kt:136)
    at com.intellij.openapi.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:105)
    at com.intellij.openapi.application.rw.InternalReadAction.access$insideReadAction(InternalReadAction.kt:14)
    at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:95)
    at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:94)
    at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke$lambda$1$lambda$0(cancellableReadAction.kt:41)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
    at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke$lambda$1(cancellableReadAction.kt:39)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:133)
    at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke(cancellableReadAction.kt:37)
    at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:248)
    at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:34)
    at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable(InternalReadAction.kt:94)
    at com.intellij.openapi.application.rw.InternalReadAction.tryReadAction(InternalReadAction.kt:76)
    at com.intellij.openapi.application.rw.InternalReadAction.readLoop(InternalReadAction.kt:63)
    at com.intellij.openapi.application.rw.InternalReadAction.access$readLoop(InternalReadAction.kt:14)
    at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invokeSuspend(InternalReadAction.kt:42)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Please let me know if you need more details on this.

DragonKnightOfBreeze commented 9 months ago

Delete 'paradox-language-support.xml'. If you don't know where it is, use 'Everything'.

Here is where it is in my computer: C:\Users\${user}\AppData\Roaming\JetBrains\IntelliJIdea2023.3\options\paradox-language-support.xml.

This is a strange issue due to deserialization of broken plugin configuration file. May be fixed and optimized in the future.

antick commented 9 months ago

Delete 'paradox-language-support.xml'. If you don't know where it is, use 'Everything'.

Here is where it is in my computer: C:\Users\${user}\AppData\Roaming\JetBrains\IntelliJIdea2023.3\options\paradox-language-support.xml.

This is a strange issue due to deserialization of broken plugin configuration file. May be fixed and optimized in the future.

Hey, thank you so much for your prompt response. I was able to resolve the issue by locating and deleting that file. And you're absolutely right. It shouldn't throw an AssertionError if any of those attributes are missing. It's quite common for the "remoteId" to be absent in descriptor files when creating a custom mod that hasn't been uploaded to the workshop.

I really appreciate your quick workaround and assistance with this. Thank you!

antick commented 9 months ago

Also, I have now started getting errors like these:

image

It wasn't like this earlier.

DragonKnightOfBreeze commented 9 months ago

Not that situation. But a situation means a value in code is null (but should not be).

DragonKnightOfBreeze commented 9 months ago

Also, I have now started getting errors like these:

image

It wasn't like this earlier.

  1. CWT config files for games exclude Stellaris is not perfect, you can send PRs or use local CWT config files. (see README)
  2. CWT config files for Stellaris is outdated, for a new game version 3.10.0 is just released.
antick commented 9 months ago

Just wanted to let you know that these are not Stellaris game files that I showed. I am actually modding Crusader Kings 3 game files. So, whatever suggestions you provided, would that also work for CK3?

antick commented 9 months ago

Update: I just switched to the CK3 from Stellaris in settings and now I don't see those errors. Sorry for the confusion and thank you so much for the help.

DragonKnightOfBreeze commented 9 months ago

This plugin use CWT config files to provide advance features, just as CWTools do, and for game exclude Stellaris, these CWT config files should be same between this plugin and CWTools.

So when some errors like 'unresolved expression' is shown when you use IDEA and this plugin to open a CK3 game file, it should be also shown when you use VSC and CWTools to open this file. (Or these are some other 'black magic's I haven't known yet.)

DragonKnightOfBreeze commented 9 months ago

And for me maintaining and updating cwt config files for games exclude Stellaris (see cwtools-stellaris-config and other repos) is not in the plan. (。・_・。)

antick commented 9 months ago

This plugin use CWT config files to provide advance features, just as CWTools do, and for game exclude Stellaris, these CWT config files should be same between this plugin and CWTools.

So when some errors like 'unresolved expression' is shown when you use IDEA and this plugin to open a CK3 game file, it should be also shown when you use VSC and CWTools to open this file. (Or these are some other 'black magic's I haven't known yet.)

Got it, thanks for explaining.

And for me maintaining and updating cwt config files for games exclude Stellaris (see cwtools-stellaris-config and other repos) is not in the plan. (。・_・。)

No problem and I already appreciate everything that you are currently doing for the community ^_^