Skip to main content

print_stats

Function print_stats 

Source
pub fn print_stats(node: &SyntaxNode<Lang>)
Expand description

Prints statistics about a YAML document’s CST.

Shows counts of different node and token types, which can be useful for understanding document complexity and debugging issues.

§Example

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

let yaml = YamlFile::from_str("team:\n  - Alice\n  - Bob").unwrap();
debug::print_stats(yaml.syntax());