From 00b758c6ee8d16387b54f9d239e5adfcf81afde0 Mon Sep 17 00:00:00 2001 From: Joachim Ansorg Date: Mon, 6 Nov 2023 12:47:41 +0100 Subject: [PATCH] fix: reject that PsiFile is fetched on the EDT thread Fixes exceptions on newer SDKs --- .../java/appland/toolwindow/appmap/AppMapWindowPanel.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin-core/src/main/java/appland/toolwindow/appmap/AppMapWindowPanel.java b/plugin-core/src/main/java/appland/toolwindow/appmap/AppMapWindowPanel.java index 4fdd76a4..d5e5d6a6 100644 --- a/plugin-core/src/main/java/appland/toolwindow/appmap/AppMapWindowPanel.java +++ b/plugin-core/src/main/java/appland/toolwindow/appmap/AppMapWindowPanel.java @@ -114,6 +114,11 @@ public void dispose() { @Override public @Nullable Object getData(@NotNull @NonNls String dataId) { + // don't provide PsiFile on the EDT, but delegate to the slow providers + if (CommonDataKeys.PSI_FILE.is(dataId) || CommonDataKeys.NAVIGATABLE.is(dataId)) { + return null; + } + if (PlatformCoreDataKeys.SLOW_DATA_PROVIDERS.is(dataId)) { return List.of((DataProvider) this::getDataImpl); }