Skip to content

Commit

Permalink
fix: reject that PsiFile is fetched on the EDT thread
Browse files Browse the repository at this point in the history
Fixes exceptions on newer SDKs
  • Loading branch information
jansorg authored and ahtrotta committed Nov 10, 2023
1 parent 1bcf1e0 commit a61a9ee
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a61a9ee

Please sign in to comment.