MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / reset_layout

Method reset_layout

src/app/mod.rs:404–438  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

402 self.pending_close = None;
403 self.cursor_pos = None;
404 self.launch_mode = LaunchMode::Run;
405 self.memory_view = debug_view::MemoryViewState::default();
406 self.inspector = inspector::InspectorState::default();
407 self.last_build = None;
408 self.reset_machine_views();
409 self.mark_build_stale();
410 self.selected_config = 0;
411 self.reset_layer_for_active_file();
412 if !self.workspace.run_configs().configs.is_empty() {
413 self.select_config(0);
414 }
415 self.status_message = Some(format!("opened {label}"));
416 }
417
418 pub(super) fn document_focus_changed(&mut self) {
419 self.main_surface = MainSurface::Document;
420 self.reset_layer_for_active_file();
421 // Switching tabs must not dim the lit spine; only edits and builds may.
422 self.stage_cache = None;
423 self.stage_locate = None;
424 }
425
426 pub(super) fn active_source_kind(&self) -> SourceKind {
427 self.active_path()
428 .map(|path| Self::source_kind_for_path(path.as_str()))
429 .unwrap_or(SourceKind::Other)
430 }
431
432 pub(super) fn source_kind_for_path(path: &str) -> SourceKind {
433 if path.ends_with(".build") {
434 SourceKind::Build
435 } else if path.ends_with(".hll") {
436 SourceKind::Hll
437 } else if path.ends_with(".ir") {
438 SourceKind::Ir
439 } else if path.ends_with(".s") {
440 SourceKind::Asm
441 } else if path.ends_with(".elf") || path.ends_with(".o") {

Callers 3

defaultMethod · 0.80
newMethod · 0.80
ide_top_barMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected