vaadin/intellij-plugin

[Error report] java.lang.Throwable: WorkspaceFileIndex is not initialized yet, empty data is returned. Activities which use the project configuration must be postponed until the project is fully loaded.

usedomer opened this issue · 1 comments

Plugin version: 1.3.6
IDE version: IntelliJ IDEA 2024.2.4
OS: Windows 11

Stacktrace:

java.lang.Throwable: WorkspaceFileIndex is not initialized yet, empty data is returned. Activities which use the project configuration must be postponed until the project is fully loaded.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getMainIndexData(WorkspaceFileIndexImpl.kt:304)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:260)
	at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.findFileSet(WorkspaceFileIndexImpl.kt:216)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.isInLibrary(ProjectFileIndexImpl.java:205)
	at com.intellij.psi.search.ProjectScopeBuilderImpl$2.contains(ProjectScopeBuilderImpl.java:63)
	at com.intellij.java.library.JavaLibraryModificationTracker$1.fileWithNoDocumentChanged(JavaLibraryModificationTracker.java:45)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:722)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:686)
	at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:514)
	at com.intellij.util.messages.impl.ToDirectChildrenMessagePublisher.publish$intellij_platform_core(CompositeMessageBus.kt:310)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:471)
	at jdk.proxy2/jdk.proxy2.$Proxy24.fileWithNoDocumentChanged(Unknown Source)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.multiCast(FileDocumentManagerImpl.java:174)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$new$0(FileDocumentManagerImpl.java:130)
	at jdk.proxy2/jdk.proxy2.$Proxy24.fileWithNoDocumentChanged(Unknown Source)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.contentsChanged(FileDocumentManagerImpl.java:692)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$MyAsyncFileListener$1.afterVfsChange(FileDocumentManagerImpl.java:642)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport.afterVfsChange(AsyncEventSupport.java:136)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport$1.after(AsyncEventSupport.java:65)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:722)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:686)
	at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:514)
	at com.intellij.util.messages.impl.ToDirectChildrenMessagePublisher.publish$intellij_platform_core(CompositeMessageBus.kt:279)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:471)
	at jdk.proxy2/jdk.proxy2.$Proxy240.after(Unknown Source)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.lambda$fireAfterEvents$20(PersistentFSImpl.java:1510)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.runSuppressing(PersistentFSImpl.java:1140)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.fireAfterEvents(PersistentFSImpl.java:1507)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl$3.close(PersistentFSImpl.java:1060)
	at com.intellij.openapi.vfs.VfsUtilCore.saveText(VfsUtilCore.java:384)
	at com.intellij.openapi.vfs.VfsUtil.saveText(VfsUtil.java:41)
	at com.vaadin.plugin.copilot.CopilotPluginUtil$Companion$saveDotFile$2$1.invoke(CopilotPluginUtil.kt:113)
	at com.vaadin.plugin.copilot.CopilotPluginUtil$Companion$saveDotFile$2$1.invoke(CopilotPluginUtil.kt:95)
	at com.intellij.openapi.application.ActionsKt.runWriteAction$lambda$0(actions.kt:16)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$5(AnyThreadWriteThreadingSupport.kt:320)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:320)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:895)
	at com.intellij.openapi.application.ActionsKt.runWriteAction(actions.kt:16)
	at com.vaadin.plugin.copilot.CopilotPluginUtil$Companion$saveDotFile$2.invoke(CopilotPluginUtil.kt:95)
	at com.vaadin.plugin.copilot.CopilotPluginUtil$Companion$saveDotFile$2.invoke(CopilotPluginUtil.kt:94)
	at com.intellij.openapi.application.ActionsKt.invokeLater$lambda$5(actions.kt:66)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:229)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardIm

Copilot plugin initialization should be postponed after indexing is completed.