[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
This commit is contained in:
Anna Kozlova
2025-04-23 08:06:29 +00:00
committed by intellij-monorepo-bot
parent 84a11b9b1e
commit 156e14cfec
@@ -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;
}