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

Method compile

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

Source from the content-addressed store, hash-verified

713 use full_stack::compilation_pipeline::DiagnosticLevel;
714 let Some(cache) = &self.stage_cache else {
715 return;
716 };
717 let root = self
718 .active_build_target
719 .as_ref()
720 .map(|target| target.root_path.as_str().to_owned());
721 for diag in &cache.result.diagnostics {
722 let stream = match diag.level {
723 DiagnosticLevel::Error => ConsoleStream::Error,
724 DiagnosticLevel::Warning => ConsoleStream::Warning,
725 };
726 let block = match &root {
727 Some(root) => diag.render(root),
728 None => diag.format_full(),
729 };
730 let link = match (&diag.span, &root) {
731 (Some(span), Some(root)) => Some((root.clone(), span.line as usize)),
732 _ => None,
733 };
734 for (i, line) in block.lines().enumerate() {
735 let stream = if i == 0 {
736 stream
737 } else {
738 ConsoleStream::Detail
739 };
740 match &link {
741 Some((path, target)) if i == 0 || line.trim_start().starts_with("-->") => {
742 self.terminal
743 .push_linked(stream, line, path.clone(), *target);
744 }
745 _ => self.terminal.push(stream, line),
746 }
747 }
748 }
749 if let Some(err) = &cache.result.assembler_error {
750 self.terminal.push(ConsoleStream::Error, err.clone());
751 }
752 if failed && cache.result.diagnostics.is_empty() && cache.result.assembler_error.is_none() {
753 self.terminal.push(
754 ConsoleStream::Error,
755 "Build failed without a diagnostic payload.",
756 );
757 }
758 }
759
760 pub(super) fn jump_to_source(&mut self, path: &str, line: usize) {
761 let Ok(vpath) = VPath::parse(path) else {
762 return;
763 };
764 // Only reopen when the file is not already active, so the stage cache
765 // (and with it the editor's diagnostic markers) survives the jump.
766 if self.active_path().as_ref() != Some(&vpath) {
767 self.open_path(vpath.clone());
768 if self.active_path().as_ref() != Some(&vpath) {
769 return;
770 }
771 }
772 self.pending_jump = Some((vpath, line));

Callers 11

cmd_hll_to_irFunction · 0.45
cmd_hll_to_asmFunction · 0.45
catalog_uiMethod · 0.45
render_catalog_rowMethod · 0.45
newMethod · 0.45
init_stdlib_cacheMethod · 0.45
set_target_modeMethod · 0.45
ide_top_barMethod · 0.45

Calls 15

get_stdlib_type_preludeFunction · 0.85
parse_hex_or_decFunction · 0.85
resolve_build_programMethod · 0.80
is_stdlibMethod · 0.80
is_osMethod · 0.80
set_module_resolverMethod · 0.80
set_artifact_stemMethod · 0.80
set_entry_pointMethod · 0.80
set_link_layoutMethod · 0.80