Tidy up single-file worktrees' opening errors (#44455)
Part of https://github.com/zed-industries/zed/issues/44370 Also log when fail to open the project item. Release Notes: - N/A
This commit is contained in:
@@ -11,6 +11,7 @@ use zed_actions::workspace::OpenWithSystem;
|
||||
use crate::Item;
|
||||
|
||||
/// A view to display when a certain buffer/image/other item fails to open.
|
||||
#[derive(Debug)]
|
||||
pub struct InvalidItemView {
|
||||
/// Which path was attempted to open.
|
||||
pub abs_path: Arc<Path>,
|
||||
|
||||
@@ -675,6 +675,7 @@ impl ProjectItemRegistry {
|
||||
Ok((project_entry_id, build_workspace_item))
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("Failed to open a project item: {e:#}");
|
||||
if e.error_code() == ErrorCode::Internal {
|
||||
if let Some(abs_path) =
|
||||
entry_abs_path.as_deref().filter(|_| is_file)
|
||||
|
||||
Reference in New Issue
Block a user