Skip to content

Commit

Permalink
Different approach to ignored, set a flag on atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Aug 1, 2024
1 parent 5d7d703 commit 69801c0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,20 @@ fn list_from_cursor<'a>(
cursor.goto_parent();

if should_ignore_last_child(config, &root_node, &between_delim) {
between_delim.pop();
if let Some(last_child) = between_delim.pop() {
if let Syntax::Atom {
position,
content,
kind,
..
} = last_child
{
let position = position.clone();
// TODO: New unused kind for atoms.
let new_last_child = Syntax::new_atom(arena, position, content, *kind);
between_delim.push(new_last_child);
}
}
}

let inner_list = Syntax::new_list(
Expand Down

0 comments on commit 69801c0

Please sign in to comment.