(node: &SceneNodeEntry)
| 2995 | state.active_glb_summary.clone() |
| 2996 | } else { |
| 2997 | "GLB asset\nopen row -> inspect meshes/materials/animations".to_string() |
| 2998 | }; |
| 2999 | } |
| 3000 | if path.ends_with(".panim") { |
| 3001 | return panim_summary(&state.project_root, path); |
| 3002 | } |
| 3003 | if kind == "script" || (kind == "resource" && !path.ends_with(".panim")) { |
| 3004 | return text_asset_preview(&state.project_root, path); |
| 3005 | } |
| 3006 | if kind == "scene" |
| 3007 | && !state.doc_text.is_empty() |
| 3008 | && state.open_paths.get(state.active_open).map(String::as_str) == Some(path) |
| 3009 | { |
| 3010 | let doc = cached_scene_doc_shared(&state.doc_text); |
| 3011 | return format!( |
| 3012 | "nodes={}\nmode={}", |
| 3013 | doc.scene.nodes.len(), |
| 3014 | editor_scene::root_viewport_mode(&doc) |
| 3015 | ); |
| 3016 | } |
| 3017 | format!("{kind} asset") |
| 3018 | } |
| 3019 | |
| 3020 | pub fn text_asset_preview(project_root: &str, path: &str) -> String { |
| 3021 | let abs = res_to_abs(project_root, path); |
| 3022 | let Ok(text) = FileMod::load_string(&abs) else { |
no test coverage detected