Function ra_ap_test_utils::extract_annotations[][src]

pub fn extract_annotations(text: &str) -> Vec<(TextRange, String)>
Expand description

Extracts //^^^ some text annotations.

A run of ^^^ can be arbitrary long and points to the corresponding range in the line above.

The // ^file text syntax can be used to attach text to the entirety of the file.

Multiline string values are supported:

// ^^^ first line // | second line

Annotations point to the last line that actually was long enough for the range, not counting annotations themselves. So overlapping annotations are possible:

// stuff        other stuff
// ^^ 'st'
// ^^^^^ 'stuff'
//              ^^^^^^^^^^^ 'other stuff'