Skip to main content

graphviz_dot

Function graphviz_dot 

Source
pub fn graphviz_dot(node: &SyntaxNode<Lang>) -> String
Expand description

Generate GraphViz DOT format visualization of the CST.

This creates a visual graph representation suitable for rendering with GraphViz tools like dot.

ยงExample

use yaml_edit::{YamlFile, debug::graphviz_dot};
use rowan::ast::AstNode;
use std::str::FromStr;

let yaml = YamlFile::from_str("name: Alice").unwrap();
let dot = graphviz_dot(yaml.syntax());
// Save to file and render with: dot -Tpng output.dot -o output.png