[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


(cherry picked from commit fece6faa6154eadfb6565ad3ae093c2e7840d31a)

IJ-CR-160935

GitOrigin-RevId: 88c2a5d41f41d1c823ca7de6df5e938811e223f0
This commit is contained in:
Anna Kozlova
2025-04-22 20:51:45 +02:00
committed by intellij-monorepo-bot
parent 3a81c685bc
commit ba21f5f3f2

View File

@@ -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;
}