From 156e14cfec9067e756f6727066cdf08cf70cd871 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Tue, 22 Apr 2025 20:51:45 +0200 Subject: [PATCH] [kotlin] don't start navigation element computation for physical files - in the end, for the physical binary file, the language level would be calculated by the file itself, and for the source file, the navigation element should be the same file anyway ^KTIJ-33883 fixed KT-75830 GitOrigin-RevId: fece6faa6154eadfb6565ad3ae093c2e7840d31a --- java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java index 3e455d10c367..0b2f1b5e3d1c 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/util/PsiUtil.java @@ -1143,7 +1143,7 @@ public final class PsiUtil extends PsiUtilCore { PsiFile file = element.getContainingFile(); // Could be non-physical 'light file' created by some JVM languages - PsiFile navigationFile = file == null ? null : ObjectUtils.tryCast(file.getNavigationElement(), PsiFile.class); + PsiFile navigationFile = file == null || file.isPhysical() ? null : ObjectUtils.tryCast(file.getNavigationElement(), PsiFile.class); if (navigationFile != null) { file = navigationFile; }