Skip to main content

node_range_with_decorators

Function node_range_with_decorators 

Source
pub fn node_range_with_decorators(
    node: &Node<'_>,
    source: &str,
    lang: LangId,
) -> Range
Expand description

Build a Range from a tree-sitter Node, expanding upward to include preceding attributes, decorators, and doc comments that belong to the symbol.

This ensures that when agents edit/replace a symbol, they get the full declaration including #[test], #[derive(...)], /// doc, @decorator, etc.