Skip to content

fix(amazonq): refreshVfs off EDT #5727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2025
Merged

fix(amazonq): refreshVfs off EDT #5727

merged 2 commits into from
May 19, 2025

Conversation

rli
Copy link
Contributor

@rli rli commented May 16, 2025

java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:375)
	at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:113)
	at com.intellij.openapi.vfs.newvfs.persistent.FSRecordsImpl.update(FSRecordsImpl.java:756)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.findChildInfo(PersistentFSImpl.java:620)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findInPersistence(VirtualDirectoryImpl.java:155)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.doFindChild(VirtualDirectoryImpl.java:138)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:84)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.refreshAndFindChild(VirtualDirectoryImpl.java:387)
	at com.intellij.openapi.vfs.newvfs.VfsImplUtil.refreshAndFindFileByPath(VfsImplUtil.java:118)
	at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshAndFindFileByPath(LocalFileSystemBase.java:67)
	at com.intellij.openapi.vfs.LocalFileSystem.refreshAndFindFileByIoFile(LocalFileSystem.java:45)
	at com.intellij.util.containers.ContainerUtil.map(ContainerUtil.java:2165)
	at com.intellij.openapi.vfs.VfsUtil.markDirtyAndRefresh(VfsUtil.java:489)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.AmazonQLanguageClientImpl.refreshVfs$lambda$33(AmazonQLanguageClientImpl.kt:416)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

```
java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:375)
	at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:113)
	at com.intellij.openapi.vfs.newvfs.persistent.FSRecordsImpl.update(FSRecordsImpl.java:756)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.findChildInfo(PersistentFSImpl.java:620)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findInPersistence(VirtualDirectoryImpl.java:155)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.doFindChild(VirtualDirectoryImpl.java:138)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:84)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.refreshAndFindChild(VirtualDirectoryImpl.java:387)
	at com.intellij.openapi.vfs.newvfs.VfsImplUtil.refreshAndFindFileByPath(VfsImplUtil.java:118)
	at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshAndFindFileByPath(LocalFileSystemBase.java:67)
	at com.intellij.openapi.vfs.LocalFileSystem.refreshAndFindFileByIoFile(LocalFileSystem.java:45)
	at com.intellij.util.containers.ContainerUtil.map(ContainerUtil.java:2165)
	at com.intellij.openapi.vfs.VfsUtil.markDirtyAndRefresh(VfsUtil.java:489)
	at software.aws.toolkits.jetbrains.services.amazonq.lsp.AmazonQLanguageClientImpl.refreshVfs$lambda$33(AmazonQLanguageClientImpl.kt:416)
```
@rli rli requested a review from a team as a code owner May 16, 2025 21:35
Copy link

github-actions bot commented May 16, 2025

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@rli rli changed the title fix(amazonq): refreshVfs async to try to avoid slow EDT op fix(amazonq): refreshVfs off EDT May 16, 2025
@rli rli merged commit 9b97fde into feature/q-lsp-chat May 19, 2025
13 of 16 checks passed
@rli rli deleted the rli-patch-10 branch May 19, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants