@@ -470,13 +470,10 @@ impl Syntax {
470470 })
471471 };
472472
473− // HAXX: for now, clear all layers except root so they get re-parsed
474− // self.layers.retain(|id, _| id == self.root);
475−
476473 // Convert the changeset into tree sitter edits.
477474 let edits = generate_edits(old_source, changeset);
478475
479− // TODO: use the edits to update all layers markers
476+ // Use the edits to update all layers markers
480477 if !edits.is_empty() {
481478 fn point_add(a: Point, b: Point) -> Point {
482479 if b.row > 0 {
@@ -716,25 +713,6 @@ impl Syntax {
716713 self.layers[self.root].tree()
717714 }
718715
719− // root: Tree
720− // injections: Vec<(Tree, Range marker)>
721−
722− // handle updates that go over a part of the layer by truncating them to start/end appropriately
723−
724− // injections tracked by marker:
725− // if marker areas match it's fine and update
726− // if not found add new layer
727− // if length 0 then area got removed, clean up the layer
728− //
729− // layer update:
730− // if range.len = 0 then remove the layer
731− // calculate affected range and update injections
732− // injection update:
733− // look for existing injections
734− // if present, range = (first injection start, last injection end)
735−
736− // Highlighting
737−
738716 /// Iterate over the highlighted regions for a given slice of source code.
739717 pub fn highlight_iter<'a>(
740718 &'a self,
@@ -813,8 +791,6 @@ impl Syntax {
813791 result.sort_layers();
814792 result
815793 }
816− // on_tokenize
817− // on_change_highlighting
818794
819795 // Commenting
820796 // comment_strings_for_pos
@@ -826,12 +802,6 @@ impl Syntax {
826802 // indent_level_for_line
827803
828804 // TODO: Folding
829−
830− // Syntax APIs
831− // get_syntax_node_containing_range ->
832− // ...
833− // get_syntax_node_at_pos
834− // buffer_range_for_scope_at_pos
835805}
836806
837807#[derive(Debug)]
@@ -938,12 +908,6 @@ pub(crate) fn generate_edits(
938908 let (start_byte, start_position) = point_at_pos(old_text, old_pos);
939909 let (old_end_byte, old_end_position) = point_at_pos(old_text, old_end);
940910
941− // TODO: Position also needs to be byte based...
942− // let byte = char_to_byte(old_pos)
943− // let line = char_to_line(old_pos)
944− // let line_start_byte = line_to_byte()
945− // Position::new(line, line_start_byte - byte)
946−
947911 // deletion
948912 edits.push(tree_sitter::InputEdit {
949913 start_byte, // old_pos to byte