fn refresh_node_expression(
        &self,
        id: graph_editor::NodeId,
        node: &controller::graph::Node,
        trees: NodeTrees,
    ) {
        let code_and_trees = graph_editor::component::node::Expression {
            pattern:             node.info.pattern().map(|t| t.repr()),
            code:                node.info.expression().repr(),
            whole_expression_id: node.info.expression().id,
            input_span_tree:     trees.inputs,
            output_span_tree:    trees.outputs.unwrap_or_else(default),
        };
        let expression_changed =
            !self.expression_views.borrow().get(&id).contains(&&code_and_trees);
        let node_is_being_edited = self.view.graph().frp.node_being_edited.value().contains(&id);
        if expression_changed && !node_is_being_edited {
            for sub_expression in node.info.ast().iter_recursive() {
                if let Some(expr_id) = sub_expression.id {
                    self.node_view_by_expression.borrow_mut().insert(expr_id, id);
                }
            }
            info!(self.logger, "Refreshing node {id:?} expression");
            self.view.graph().frp.input.set_node_expression.emit(&(id, code_and_trees.clone()));
            self.expression_views.borrow_mut().insert(id, code_and_trees);
        }

        // Set initially available type information on ports (identifiable expression's sub-parts).
        for expression_part in node.info.expression().iter_recursive() {
            if let Some(id) = expression_part.id {
                self.refresh_computed_info(id, expression_changed);
            }
        }
    }
/// Update the expression of the node and all related properties e.g., types, ports).
Update the expression of the node and all related properties e.g., types, ports).
Update the expression of the node and all related properties e . g . types ports ) .
fn refresh_node_expression(
        &self,
        id: graph_editor::NodeId,
        node: &controller::graph::Node,
        trees: NodeTrees,
    ) {
        let code_and_trees = graph_editor::component::node::Expression {
            pattern:             node.info.pattern().map(|t| t.repr()),
            code:                node.info.expression().repr(),
            whole_expression_id: node.info.expression().id,
            input_span_tree:     trees.inputs,
            output_span_tree:    trees.outputs.unwrap_or_else(default),
        };
        let expression_changed =
            !self.expression_views.borrow().get(&id).contains(&&code_and_trees);
        let node_is_being_edited = self.view.graph().frp.node_being_edited.value().contains(&id);
        if expression_changed && !node_is_being_edited {
            for sub_expression in node.info.ast().iter_recursive() {
                if let Some(expr_id) = sub_expression.id {
                    self.node_view_by_expression.borrow_mut().insert(expr_id, id);
                }
            }
            info!(self.logger, "Refreshing node {id:?} expression");
            self.view.graph().frp.input.set_node_expression.emit(&(id, code_and_trees.clone()));
            self.expression_views.borrow_mut().insert(id, code_and_trees);
        }
        // Set initially available type information on ports (identifiable expression's sub-parts).
        for expression_part in node.info.expression().iter_recursive() {
            if let Some(id) = expression_part.id {
                self.refresh_computed_info(id, expression_changed);
            }
        }
    }
fn refresh_node_expression ( & self , id : graph_editor :: NodeId , node : & controller :: graph :: Node , trees : NodeTrees , ) { let code_and_trees = graph_editor :: component :: node :: Expression { pattern : node . info . pattern ( ) . map ( | t | t . repr ( ) ) , code : node . info . expression ( ) . repr ( ) , whole_expression_id : node . info . expression ( ) . id , input_span_tree : trees . inputs , output_span_tree : trees . outputs . unwrap_or_else ( default ) , } ; let expression_changed = ! self . expression_views . borrow ( ) . get ( & id ) . contains ( & & code_and_trees ) ; let node_is_being_edited = self . view . graph ( ) . frp . node_being_edited . value ( ) . contains ( & id ) ; if expression_changed && ! node_is_being_edited { for sub_expression in node . info . ast ( ) . iter_recursive ( ) { if let Some ( expr_id ) = sub_expression . id { self . node_view_by_expression . borrow_mut ( ) . insert ( expr_id , id ) ; } } info ! ( self logger " " ) ; self . view . graph ( ) . frp . input . set_node_expression . emit ( & ( id , code_and_trees . clone ( ) ) ) ; self . expression_views . borrow_mut ( ) . insert ( id , code_and_trees ) ; } // Set initially available type information on ports (identifiable expression's sub-parts). for expression_part in node . info . expression ( ) . iter_recursive ( ) { if let Some ( id ) = expression_part . id { self . refresh_computed_info ( id , expression_changed ) ; } } }
Update the expression of the node and all related properties e.g., types, ports).
Update the expression of the node and all related properties e . g . types ports ) .
&self
id
graph_editor::NodeId
node
&controller::graph::Node
trees
NodeTrees
&self
id
graph_editor::NodeId
node
&controller::graph::Node
trees
NodeTrees