(root: &Path)
| 249 | } |
| 250 | |
| 251 | pub fn add_recent_project<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>, root: &str) { |
| 252 | let mut recent = load_recent_projects(); |
| 253 | recent.retain(|item| item != root); |
| 254 | recent.insert(0, root.to_string()); |
| 255 | recent.truncate(MAX_RECENT); |
| 256 | save_recent_projects(&recent); |
| 257 | let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| { |
| 258 | state.recent_projects = recent; |
| 259 | }); |
| 260 | } |
| 261 | |
| 262 | pub fn validate_project_root(root: &Path) -> Result<(), String> { |
no test coverage detected