You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: printer.rs
    path of file: ./repos/Ambient/shared_crates/package_semantic/src
    
    the code of the file until where you have to start completion: use crate::{
    Attribute, Component, Concept, Item, ItemMap, Message, Package, ResolvableItemId, Scope,
    Semantic, Type, TypeInner,
};

pub struct Printer {
    indent: usize,
}
impl Printer {
    pub fn new() -> Self {
        Self { indent: 0 }
    }

    pub fn print(&mut self, semantic: &Semantic) -> anyhow::Result<()> {
        let items = &semantic.items;
        println!("root_scope:");
        self.with_indent(|p| {
            p.print_scope(items, items.get(semantic.root_scope_id))?;
            Ok(())
        })?;

        println!("packages:");
        self.with_indent(|p| {
            for id in semantic.packages.values() {
                p.print_package(items, items.get(*id))?;
            }
            Ok(())
        })?;

        Ok(())
    }

    fn print_package(&mut self, items: &ItemMap, package: &Package) -> anyhow::Result<()> {
        self.print_indent();
        println!(
            "{}",
            fully_qualified_display_path_ambient_style(items, package)
        );

        self.with_indent(|p| {
            p.print_indent();
            println!("locator: {:?}", package.locator);

            p.print_indent();
            println!(
                "dependent: {}",
                package
                    .dependent_package_id
                    .map(|id| fully_qualified_display_path_ambient_style(items, items.get(
    
    fn print_scope(&mut self, items: &ItemMap, scope: &Scope) -> anyhow::Result<()> {
        self.print_indent();
        println!(
            "{}",
            fully_qualified_display_path_ambient_style(items, scope)
        );

        self.with_indent(|p| {
            p.print_indent();
            println!("imports: ");
            p.with_indent(|p| {
                for (import_name, package_id) in &scope.imports {
                    let package_path =
                        fully_qualified_display_path_ambient_style(items, items.get(*package_id));
                    p.print_indent();
                    println!("{import_name} => {package_path}");
                }
                Ok(())
            })?;

            for id in scope.components.values() {
                p.print_component(items, items.get(*id))?;
            }

            for id in scope.concepts.values() {
                p.print_concept(items, items.get(*id))?;
            }

            for id in scope.messages.values() {
                p.print_message(items, items.get(*id))?;
            }

            for id in scope.types.values() {
                p.print_type(items, items.get(*id))?;
            }

            for id in scope.attributes.values() {
                p.print_attribute(items, items.get(*id))?;
            }

            for id in scope.scopes.values() {
                p.print_scope(items, items.get(*id))?;
            }

            Ok(())
        })?;

        Ok(())
    }