From a01f3fa5b3f11e18a7da8f8b65d32e277a11cb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=87=E7=A8=8B?= <1498425439@qq.com> Date: Tue, 16 Jan 2024 22:00:06 +0800 Subject: [PATCH] fix(TreeCache): exception when build index --- .../io/github/linwancen/plugin/show/cache/TreeCacheUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java b/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java index bd7a8b2..b3d9028 100644 --- a/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java +++ b/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java @@ -1,7 +1,6 @@ package io.github.linwancen.plugin.show.cache; import com.intellij.ide.projectView.ProjectViewNode; -import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; @@ -70,7 +69,7 @@ public class TreeCacheUtils { nodeCache.forEach((node, treeCache) -> { if (treeCache.needUpdate) { treeCache.needUpdate = false; - ApplicationManager.getApplication().runReadAction(() -> { + DumbService.getInstance(project).runReadActionInSmartMode(() -> { try { treeCache.doc = Tree.treeDoc(node, project); } catch (Exception e) {