@@ -41,11 +41,17 @@ impl StatementChange {
4141 }
4242}
4343
44+ /// Returns all relevant details about the change and its effects on the current state of the document.
4445struct Affected {
46+ /// Full range of the change, including the range of all statements that intersect with the change
4547 affected_range : TextRange ,
48+ /// All indices of affected statement positions
4649 affected_indices : Vec < usize > ,
50+ /// The index of the first statement position before the change, if any
4751 prev_index : Option < usize > ,
52+ /// The index of the first statement position after the change, if any
4853 next_index : Option < usize > ,
54+ /// the full affected range includng the prev and next statement
4955 full_affected_range : TextRange ,
5056}
5157
@@ -79,11 +85,11 @@ impl Document {
7985 changes. extend (
8086 pg_statement_splitter:: split ( & self . content )
8187 . ranges
82- . iter ( )
88+ . into_iter ( )
8389 . map ( |range| {
8490 let id = self . id_generator . next ( ) ;
85- let text = self . content [ * range] . to_string ( ) ;
86- self . positions . push ( ( id, * range) ) ;
91+ let text = self . content [ range] . to_string ( ) ;
92+ self . positions . push ( ( id, range) ) ;
8793
8894 StatementChange :: Added ( AddedStatement {
8995 stmt : Statement {
0 commit comments