Skip to main content

Module debug

Module debug 

Source
Expand description

Debug utilities for inspecting and understanding YAML structures.

This module provides debugging tools including:

  • CST tree visualization
  • Pretty Debug formatting showing actual values
  • Visual diffs between documents
  • Deep value inspection
  • AST visualization (GraphViz output)

These functions are useful for both contributors working on yaml-edit and users debugging their YAML documents.

Structs§

PrettyDebug
Pretty-print a YAML document showing its structure and values.
ValueInspector
Value inspector for deep type analysis.
VisualDiff
Visual diff between two YAML documents.

Functions§

graphviz_dot
Generate GraphViz DOT format visualization of the CST.
key_string
The string under which YamlValue holds key as a mapping key, or None if key holds an alias, which cannot be followed here.
print_stats
Prints statistics about a YAML document’s CST.
print_tree
Prints the CST (Concrete Syntax Tree) structure to stdout.
print_tree_indent
Prints the CST structure with a custom starting indentation.
roundtrip_ok
Roundtrip check: parse(node.to_string()).to_string() must equal node.to_string(), and the re-parse must have no errors.
shape_to_string
Like tree_to_string, but without the zero-width marker that an empty {} or [] carries when it is to become a block collection once it has an entry (see Mapping::new_pending_block). Re-parsing the text cannot recover the marker, so this is what to compare between an edited tree and a re-parse of its text.
tree_to_string
Returns a string representation of the CST structure.
validate_tree
Validates that the CST follows expected structural invariants.