mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup PsiUtilCore#getPsiFile
GitOrigin-RevId: 1305de82e07fa87388932fcff4fd2b546eeb30d5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
92a60f0ac8
commit
0703c6413c
@@ -524,7 +524,17 @@ public class PsiUtilCore {
|
||||
public static @NotNull PsiFile getPsiFile(@NotNull Project project, @NotNull VirtualFile file) {
|
||||
PsiManager psiManager = PsiManager.getInstance(project);
|
||||
PsiFile psi = psiManager.findFile(file);
|
||||
if (psi != null) return psi;
|
||||
if (psi == null) {
|
||||
logFileIsNotFound(file, psiManager, project);
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
return psi;
|
||||
}
|
||||
|
||||
private static void logFileIsNotFound(@NotNull VirtualFile file,
|
||||
@NotNull PsiManager psiManager,
|
||||
@NotNull Project project) {
|
||||
FileType fileType = file.getFileType();
|
||||
FileViewProvider viewProvider = psiManager.findViewProvider(file);
|
||||
Document document = FileDocumentManager.getInstance().getDocument(file);
|
||||
@@ -557,7 +567,6 @@ public class PsiUtilCore {
|
||||
}
|
||||
}
|
||||
LOG.error("no PSI for file '" + file.getName() + "'", new Attachment(file.getPresentableUrl(), sb.toString()));
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user