VirtualFile (@Nullable Project project, @NotNull String key, @NotNull VirtualFile file) { if (project == null) return file; final String path = PropertiesComponent.getInstance(project).getValue(key); if (path == null) return file; VirtualFile lastSelection = LocalFileSystem.getInstance().findFileByPath(path); return lastSelection != null ? lastSelection : file; }